成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? 基于jQuery實現的仿百度首頁滑動選項卡效果代碼
全站頭部文字 我要出現在這里
基于jQuery實現的仿百度首頁滑動選項卡效果代碼 633 2024-03-21   

本文實例講述了基于jQuery實現的仿百度首頁滑動選項卡效果代碼。分享給大家供大家參考,具體如下:

今天給大家分享一款基于jQuery的仿百度首頁滑動選項卡,可實現tab選項卡內容上下翻滾切換的功能。這款選項卡適用瀏覽器有:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗。效果圖如下:

查看圖片

在線演示地址如下:

http://demo.gimoo.net/js/2015/jquery-f-baidu-hd-nav-style-codes/

完整實例代碼代碼點擊此處本站下載。

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程序設計有所幫助。



主站蜘蛛池模板: 第一序列第二季上映了吗| 恋爱症候群| 计程车女孩电影| 西街少年 电视剧| 爱在记忆中找你歌词| 悄悄问圣僧女儿美不美| 少女免费观看完整电视电影| 负心人| 张子枫的全部作品| 肉丝祙挠脚心丨ⅴk| 高嘉慧| 头像女伤感| hd经典复古性mature| 天津电视台体育频道| 守株待兔的老农夫音乐教案| 天堂在线中文视频| 抖音火山版| 尹雪喜最好看的三部电影| 大场久美子| 舌吻做爰视频舌吻| 白血公主| cctv五+频道在线直播节目单| 阿尔法变频器说明书| tina kay| 三年级片| 月亮电影| 袁波| 乡村女教师 电影| 老友记 第一季 1994 詹妮弗·安妮斯顿| 影片《边境》| 碑文格式范例 墓碑图片| 无声无息电影| 西海情歌原歌词全文| 白璐个人简介照片| 丹尼尔·吉里斯| 送教上门工作情况记录表| 杨颖电影| 最佳男朋友| p333的图片| 时代少年团壁纸| 女怕嫁错郎演员表|

!!!站長長期在線接!!!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103