SpringMVC框架下JQuery傳遞并解析Json格式的數據是如何實現的
676
2024-03-17
本文實例講述了基于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程序設計有所幫助。
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!