jQuery上下滑动及左右切换导航特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery上下滑动及左右切换导航特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery上下滑动及左右切换导航特效代码

HTML代码(index.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>jQuery上下滑动及左右切换导航</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="js/home.js"></script>
</head>
<body>
<!-- 代码 开始 -->
<div class="wrap">
	<div class="header">
		<h1 class="logo"><a href="http://www.baidu.com/jiaoben" target="_blank"><img src="images/logo.jpg" alt=""></a></h1>
	</div>
	<div class="top-nav">
		<div id="navList" class="navlist-wrap">
			<div class="navlist clearfix">
				<a href="" class="nav-btn" data-device="#androidItem">Android<span>&nbsp;&nbsp;&nbsp;</span></a>
				<a href="" class="nav-btn" data-device="#iphoneItem">iPhone<span>&nbsp;&nbsp;&nbsp;</span></a>
				<a href="" class="nav-btn" data-device="#ipadItem">iPad<span>&nbsp;&nbsp;&nbsp;</span></a>
				<a href="" class="nav-btn" data-device="#pcItem">PC<span>&nbsp;&nbsp;&nbsp;</span></a>
				<a href="" class="nav-btn" data-device="#macItem">MAC<span>&nbsp;&nbsp;&nbsp;</span></a>
			</div>
		</div>
		<div id="expandZone" class="expand active">
			<div class="download">
				<div id="androidItem" class="item">
					<div class="download-list">
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn zj" id="download-link"><span class="icon"></span><span class="text">直接下载安装包</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn sjgj" id="tencent_app_assistant_btn"><span class="icon"></span><span class="text">手机管家一键下载</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn wdj"><span class="icon"></span><span class="text">豌豆荚一键下载</span></a>
					</div>
				</div>
				<div id="iphoneItem" class="item">
					<div class="download-list">
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn zj"><span class="icon"></span><span class="text">直接下载安装包</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn apple"><span class="icon"></span><span class="text">AppStore免费下载</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" title="iTools" class="btn itools"><span class="icon"></span><span class="text">itools一键安装</span></a>
					</div>
				</div>
				<div id="ipadItem" class="item">
					<div class="download-list">
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn zj"><span class="icon"></span><span class="text">直接下载安装包</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn apple"><span class="icon"></span><span class="text">AppStore免费下载</span></a>
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn itools"><span class="icon"></span><span class="text">itools一键安装</span></a>
					</div>
				</div>
				<div id="pcItem" class="item">
					<div class="download-list">
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn zj"><span class="icon"></span><span class="text">直接下载安装包</span></a>
					</div>
				</div>
				<div id="macItem" class="item">
					<div class="download-list">
						<a href="http://www.baidu.com/jiaoben/" target="_blank" class="btn zj"><span class="icon"></span><span class="text">直接下载安装包</span></a>
					</div>
				</div>
			</div>
			<div id="closeBtn" class="close-btn"></div>
		</div>
		<div class="nav-bottom-bg"></div>
	</div>
</div>
</body>
</html>







JS代码(home.js):

$(function (){
	//navlist $('#navList').on('click','.nav-btn',function(event){
	if($(this).hasClass('btn-active')){
	$('#expandZone #closeBtn').click();
	return false;
}
var curIndex = $(this).index(),mlValue = '-' + curIndex * 100 + '%';
	if( $('#expandZone').hasClass('active') ){
	$('#expandZone .download').animate({
	marginLeft:mlValue}
);
}
else{
	$('#expandZone .download').css({
	marginLeft:mlValue}
);
}
var device = $(this).data('device');
	$(this).addClass('btn-active').siblings().removeClass('btn-active');
	$(device).addClass('item-active').siblings().removeClass('item-active');
	$('#expandZone').animate({
	height:'130px'}
).addClass('active');
	return false;
}
);
	$('#expandZone #closeBtn').on('click',function(){
	$('#expandZone').animate({
	height:'0px'}
,function (){
	$(this).removeClass('active');
	$('#navList .btn-active').removeClass('btn-active');
}
);
	return false;
}
);
}
);
	

CSS代码(style.css):

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}
body{font-family:"Microsoft Yahei","微软雅黑",Tahoma,Arial,sans-serif}
.header{width:1105px;margin:0 auto;height:111px;padding:12px 0 18px;position:relative;*z-index:1}
.header .logo{height:86px;width:256px;margin-top:25px}
.top-nav .navlist-wrap{width:1050px;margin:0 auto;position:relative}
.top-nav .navlist{position:absolute;right:130PX;top:-40PX}
.top-nav .navlist .nav-btn{float:left;margin-left:60px;color:#666;vertical-align:middle;text-decoration:none}
.navlist .nav-btn span{background:url(../images/broswer_home.png) no-repeat -29px -145px;display:inline-block;width:16px;height:16px;margin-left:4px;vertical-align:middle;*height:12px;*vertical-align:middle;*cursor:pointer;*letter-spacing:0;*margin-left:0;*background-position:-26px -145px}
.navlist .btn-active span{background:url(../images/broswer_home.png) no-repeat -8px -145px;*background-position:-5px -145px}
.top-nav .expand{height:0px;background-color:#333d4d;overflow:hidden;position:relative;width:100%}
.expand .download{height:130px;width:500%;}
.expand .download .item{float:left;width:20%}
.expand .download .item-active{display:block}
.expand .close-btn{width:120px;height:20px;background:url(../images/broswer_home.png) no-repeat -13px -117px;position:absolute;left:50%;bottom:-2px;margin-left:-60px;cursor:pointer;}
.download .download-list{text-align:center;height:56px;padding:37px}
.download .download-list .btn{display:inline-block;text-decoration:none;color:#586e91;font-size:18px;line-height:24px;margin:0 28px;cursor:pointer}
.download .download-list .btn:hover{color:#7896af}
.download-list .btn .icon{background-repeat:no-repeat;background-image:url(../images/broswer_home.png);height:56px;width:56px;float:left}
.download-list .btn .text{float:left;padding:16px 0 16px 16px}
.download-list .zj .icon{background-position:-4px 0}
.download .download-list .zj{}
.download .download-list .zj:hover .icon{background-position:-5px -57px}
.download .download-list .sjgj{}
.download .download-list .sjgj .icon{background-position:-58px 0}
.download .download-list .sjgj:hover .icon{background-position:-59px -58px}
.download .download-list .wdj{}
.download-list .wdj .icon{background-position:-169px -4px}
.download-list .wdj:hover .icon{background-position:-169px -64px}
.download .download-list .jy{}
.download-list .jy .icon{background-position:-114px 0}
.download-list .jy:hover .icon{background-position:-114px -62px}
.download-list .apple .icon{background-position:-225px -1px;width:38px}
.download-list .apple:hover .icon{background-position:-225px -58px}
.download-list .itools .icon{background-position:-270px 0}
.download-list .itools:hover .icon{background-position:-270px -57px}
.top-nav .nav-bottom-bg{height:7px;_font-size:1px;background-color:#fff}
.btm{margin:30px auto;}
.btm p{font:normal 12px/24px 'Microsoft YaHei';text-align:center;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
61.52 KB
Html Js 菜单导航特效1
最新结算
股权转让协议意向书模板
类型: .docx 金额: CNY 2.23¥ 状态: 待结算 详细>
股权转让协议意向书模板
类型: .docx 金额: CNY 0.28¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 2.39¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 0.3¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章