css动画 右往左显示 侧边小提示会话隐藏 兼容ie8

<!DOCTYPE >
<html>
  <head>
    <title>侧边信息隐藏</title>
   	<meta charset="utf-8" />
   	
   	<style>
			.div-fixed,
			.div-look-btn,
			.div-content {
				height: 550px;
			}
			.div-fixed {
				position: fixed;
				bottom: 20px;
				right: -130px;
				width: 160px;
				cursor: pointer;
			}
			/* ie 兼容 position: fixed; */
			.div-ie	{   
			  _position: absolute;  
			  _clear: both;
			  _top: expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) - 1 : document.body.scrollTop + (document.body.clientHeight-this.clientHeight) - 1);
			}
			.div-look-btn {
				position: absolute;
			    top: 20%;
		    	height: 100px;
				display: inline-block;
				padding-top: 10px;
				width: 30px;
		   		font-size: 14px;
    			letter-spacing: 2px;
				background: #076ce0;
				text-align: center;
				color: #fff;
				border-top-left-radius: 4px;
				border-bottom-left-radius: 4px;
				-ms-border-top-left-radius: 4px;
				-ms-border-bottom-left-radius: 4px;
		    	line-height: 22px;
			}
			
			.div-look-btn>img {
				display: inline-block;
				position: relative;
				top: 40%;
				width: 32px;
				height: 32px;
			}
			.div-content {
				display: inline-block;
				float: right;
				width: 130px;
				background: #fff;
				text-align: center;
				border: 1px solid #eee;
			}
			.div-content-code {
				margin-top: 20px;
			}
			.div-font {
				display: block;
				font-size: 14px; 
				margin-bottom: 5px;
				font-weight: 550;
			}
			.div-img {
				width: 110px; 
				height: 110px;
			}
			.div-btn {
				display: block;
				padding: 2px 10px;
				border-radius: 2px;
				border: none;
				color: #fff;
				font-size: 14px;
				margin-top: 5px;
				width: 70%;
				margin-left: 9%;
			}
			.btn-ios {
				background: #19b4ed;
			} 
			.btn-android {
				background: #F0AD4E;
			}
			.btn-download {
				background: rgb(34, 181, 115);
				
			}
  	</style>
   	
</head>
<body>
	
  <div class="div-fixed div-ie">
  	
  	<div class="div-look-btn">
  		<!--<img src="img/btn.jpg" />-->
  		<span>扫码查看</span>
  	</div>
  	
  	<div class="div-content">
  		
  		<div class="div-content-code">
  			<span class="div-font">网速测试助手</span>
  			<a class="div-btn btn-download">立即下载</a>
  		</div>
  		
  		<div class="div-content-code">
  			<span class="div-font">移动运维门户MOP</span>
  			<a class="div-btn btn-download">立即下载</a>
  		</div>
  		
  		<div class="div-content-code">
  			<span class="div-font">服保运维客户端</span>
  			<img src="img/xiazaidizhi.png" class="div-img" />
  			<a class="div-btn btn-ios">ios</a>
  			<a class="div-btn btn-android">android</a>
  		</div>
  		
  		<div class="div-content-code">
  			<span class="div-font">服保智慧营维</span>
  			<img src="img/zhywqrcode.png" class="div-img" />
  			<a class="div-btn btn-download">立即下载</a>
  		</div>
  		
  	</div>
  </div>
  
  
  <script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
  <script>
  	$(function(){
  		
  		$('.div-fixed').hover(function(){
  			// stop(true),此时程序会把当前元素接下来尚未执行完的动画队列清空。所以可以把上面代码改成如此代码,就能实现预期的效果。
  			$(this).stop(true).animate({'right': '0'}, 'slow');
  		}, function(){
  			$(this).stop(true).animate({'right': '-130px'}, 'slow');
  		});
  		
  	});
  	
  </script>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值