jquery特效分享-一款基于jQuery的仿百度首页滑动选项卡
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了jquery特效分享-一款基于jQuery的仿百度首页滑动选项卡,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2493字,纯文字阅读大概需要4分钟。
内容图文
今天给大家分享一款基于jQuery的仿百度首页滑动选项卡。这款选项卡适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗。效果图如下:
实现的代码。
html代码:
< div class ="main-page" > < div class ="left" > < div class ="nav-back" > </ div > < div class ="nav" > < div class ="on" > 导航 </ div > < div > 新闻 </ div > < div > 世界杯 </ div > < div > 音乐 </ div > < div > 彩票 </ div > </ div > </ div > < div class ="right" > < div class ="content-back" > </ div > < div class ="content" > < div > 站长素材1 </ div > < div > 站长素材2 </ div > < div > 站长素材3 </ div > < div > 站长素材4 </ div > < div > 站长素材5 </ div > </ div > </ div > < div class ="clear" > </ div > </ div >
css代码:
body { background: url(images/65.jpg) no-repeat fixed center center; } .clear { clear: both; } .main-page { margin: 200px auto 0 auto; width: 700px; height: 300px; } .main-page .left, .main-page .right { float: left; } .main-page .nav-back { width: 60px; height: 300px; background: #000; opacity: .3; filter: alpha(opacity=30); } .main-page .nav { position: relative; margin-top: -300px; width: 60px; text-align: center; font-size: 14px; font-family: "微软雅黑"; color: #fff; } .main-page .nav div { height: 32px; line-height: 28px; } .main-page .nav div.on { background: #0094ea; } .main-page .right { width: 620px; height: 300px; margin-left: 20px; } .main-page .content-back { width: 620px; height: 300px; background: #fff; opacity: .3; } .main-page .content { position: relative; width: 600px; height: 280px; margin-top: -300px; padding: 10px; overflow: hidden; } .main-page .content div { width: 600px; height: 280px; margin-bottom: 10px; background: #fff; }
js代码:
$(".main-page .nav div").mouseenter(function () { var $this = $(this); var index = $this.index(); }).mouseleave(function () { var $this = $(this); var index = $this.index(); }).click(function () { var $this = $(this); var index = $this.index(); var l = -(index * 290); $(".main-page .nav div").removeClass("on"); $(".main-page .nav div").eq(index).addClass("on"); $(".main-page .content div:eq(0)").stop().animate({ "margin-top": l }, 500); });
其他精彩文章
jQuery教程(29)-jQuery插件开发之为插件方法指定参数
jQuery教程(28)-jQuery插件开发之使用插件
jQuery教程(27)-jQueryajax操作之修改默认选项
jQuery教程(26)-ajax操作之使用JSONP加载远程数据
原文:http://blog.csdn.net/dyllove98/article/details/42966965
内容总结
以上是互联网集市为您收集整理的jquery特效分享-一款基于jQuery的仿百度首页滑动选项卡全部内容,希望文章能够帮你解决jquery特效分享-一款基于jQuery的仿百度首页滑动选项卡所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。