zoukankan      html  css  js  c++  java
  • JS对联广告代码初级

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>对联广告</title>
    	<style>
    		#leftFloat{
    			 200px;
    			height: 280px;
    			background-color: red;
    			position: fixed;
    			left: 0px;
    			/*IE6兼容*/
    			_position:absolute;
    			_top:expression(document.documentElement.scrollTop+(document.documentElement.clientHeight-this.offsetHeigh)/2);
    		}
    		#rightFloat{
    			 200px;
    			height: 280px;
    			background-color: red;
    			position: fixed;
    			right: 0px;
    			_position:absolute;
    			_top:expression(document.documentElement.scrollTop+(document.documentElement.clientHeight-this.offsetHeigh)/2);
    		}
    		.close{
    			height: 20px;
    			 200px;
    			background-color: pink;
    			position: absolute;
    			bottom: 0px;
    			left:0px;
    			text-align: center;
    			font-size: 20px;			
    		}
    		.close a{
    			text-decoration: none;
    			color: #000;
    		}
    	</style>
    
    	<script>
    	window.onload = function (){
    		var leftdiv = document.getElementById('leftFloat');
    		var rightdiv = document.getElementById("rightFloat");
    		var t = (document.documentElement.clientHeight-leftdiv.offsetHeight)/3 + 'px';
    		leftdiv.style.top = t;
    		rightdiv.style.top = t;
    	}
    
    	function close(){
    		document.getElementById('leftFloat').style.display='none'; 
    		document.getElementById('rightFloat').style.display='none';
    	}
    	</script>
    
    </head>
    
    <body>
    	<div id="leftFloat">
    		<div class="close"><a href="javascript:close()">关闭</a></div> 
    	</div>
    	<div id="rightFloat">
    		<div class="close"><a href="javascript:close()">关闭</a></div> 
    	</div>
    </body>
    </html>
    

      

    坚持到感动自己,努力到无能为力!
  • 相关阅读:
    Jmeter之定时器
    Jmeter环境部署及目录解析
    Linux之shell脚本(基础篇)
    Linux常用命令
    Nginx详细安装部署教程(转)
    lsyncd+rsync文件实时同步
    windows7下搭建robot framework环境
    Python 类和实例
    第一个自动化运维程序
    Python之 set的特点
  • 原文地址:https://www.cnblogs.com/lzhlearn/p/5786282.html
Copyright © 2011-2022 走看看