• 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>
    

      

    坚持到感动自己,努力到无能为力!
  • 相关阅读:
    [日志]一个父亲给儿子的忠告
    [健康]预防手足口病中医有妙方
    [日志]教你怎么用一句话把人弄的又好气又好笑
    [健康]出汗与人健康
    [健康]四招,清除体内“垃圾”
    [健康]生病了绝对不能吃的东西
    [日志]塑造自己品牌的方法
    [健康]肾的保健按摩
    [日志]经典道歉短信
    [日志]几个笑话顿悟人生道理
  • 原文地址:https://www.cnblogs.com/lzhlearn/p/5786282.html
Copyright © 2020-2023  润新知