码迷,mamicode.com
首页 > Web开发 > 详细

jQuery返回顶部和在线客服网站侧边栏

时间:2019-10-01 14:28:39      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:list   技术   alpha   top   size   com   icon   back   opacity   

效果图:
技术图片
全部代码:
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
	*{margin:0;padding:0;}
	ul{list-style: none;}
	.slide{
		position: fixed;
		right:0;
		top:200px;
		z-index: 100;
		width:54px;
		height: 275px;
	}
	.slide ul li{
		width:54px;
		height: 54px;
		float: left;
		position: relative;
		border-bottom:1px solid #444;
	}

	.slide ul li .slide-box{
		position: absolute;
		top:0;
		right:0;
		width:54px;
		height: 54px;
		color:#fff;
		background: #000;
		opacity: 0.8;
		filter:Alpha(opacity=80);
		font-size:14px;
		overflow: hidden;
		line-height: 54px;
	}
	.slide ul li .slide-top{
		width: 54px;
		height: 54px;
		line-height: 54px;
		display: inline-block;
		background: #000;
		opacity: 0.8;
		filter:Alpha(opacity=80);
		transition: all 0.3s;
	}
	.slide ul li .slide-top:hover{
		opacity: 1;
		filter:Alpha(opacity=100);
		background: #ae1c1c;
	}
	.slide ul li img{
		float:left;
	}
	</style>
	<script type="text/javascript" src=‘js/jquery-2.0.3.min.js‘></script>
	<script type="text/javascript">
	$(function(){
		$(".slide ul li").hover(function(){
				
			$(this).find(".slide-box").stop().animate({
				"width":"124px"
			},200).css({
				"opacity":"1",
				"filter":"Alpha(opacity=100)",
				"background":"#ae1c1c"
			})

		},function(){
			$(this).find(".slide-box").stop().animate({
				"width":"54px"
			},200).css({
				"opacity":"0.8",
				"filter":"Alpha(opacity=80)",
				"background":"#000"
			})
		})
		$(".slide-top").click(function(){
			$("html,body").animate({‘scrollTop‘:0},500);
		})
	})
	</script>
</head>
<body style="height: 2000px;">


<div class=‘slide‘>

	<ul>
		<li>
			<a href="javascript:;">
				<div class=‘slide-box‘>
					<img src="img/side_icon01.png">客服中心
				</div>
			</a>
		</li>
		<li>
			<a href="javascript:;">
				<div class=‘slide-box‘>
					<img src="img/side_icon02.png">客户案例
				</div>
			</a>
		</li>
		<li>
			<a href="javascript:;">
				<div class=‘slide-box‘>
					<img src="img/side_icon03.png">新浪微博
				</div>
			</a>
		</li>
		<li>
			<a href="javascript:;">
				<div class=‘slide-box‘>
					<img src="img/side_icon04.png">QQ客服
				</div>
			</a>
		</li>

		<li>
			<a href="javascript:;" class=‘slide-top‘>
				<img src="img/side_icon05.png">
			</a>
		</li>

	</ul>
	
</div>

</body>
</html>
每日分享效果附带视频:https://www.3mooc.com/front/couinfo/999

jQuery返回顶部和在线客服网站侧边栏

标签:list   技术   alpha   top   size   com   icon   back   opacity   

原文地址:https://www.cnblogs.com/ganjiang/p/11615207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!