jQuery簡單實現(xiàn)仿京東分類導(dǎo)航層效果
本文實例講述了jQuery簡單實現(xiàn)仿京東分類導(dǎo)航層效果。分享給大家供大家參考,具體如下:
<script src="jquery-1.11.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { var alink01 = $(".item > ul"); alink01.hover(function () { //alert div var divId = $(this).find("div").attr("id"); var div = $("#" + divId); //要浮動在這個元素旁邊的層 div.css("position", "absolute"); //讓這個層可以絕對定位 var self = $(this); //當(dāng)前對象 div.css("display", "block"); var p = self.position(); //獲取這個元素的left和top var x = p.left + self.width(); //獲取這個浮動層的left div.css("left", x + 45); //20140916修改 div.css("top", p.top); div.show(); //mouseenter $(this).removeClass("unfocus").addClass("focus"); }, function () { var divId = $(this).find("div").attr("id"); var div = $("#" + divId); //要浮動在這個元素旁邊的層 div.css("display", "none"); //mouseleave $(this).removeClass("focus").addClass("unfocus"); }); }); </script>
<div class="leftbody"> <div class="item"> <span>全部分類</span> <ul class="focus"> <li ><strong>php</strong> <br /> php基本語法 php實例 </li> </ul> <ul class="unfocus"> <li ><strong>java</strong> <br /> java語法 java面向?qū)ο? </li> </ul> <ul class="unfocus"> <li ><strong>Python</strong> <br /> Python語法 Python圖形處理 </li> </ul> <ul class="unfocus"> <li ><strong>javascript</strong> <br /> javascript幻燈片 javascript網(wǎng)頁特效 </li> </ul> <ul class="unfocus"> <li ><strong>C#</strong> <br /> C#桌面應(yīng)用程序 C#網(wǎng)絡(luò)程序 </li> </ul> <ul class="unfocus"> <li ><strong>VC++</strong> <br /> VC++系統(tǒng)程序開發(fā) VC++網(wǎng)絡(luò)程序 </li> </ul> <ul class="unfocus"> <li ><strong>Delphi</strong> <br /> Delphi桌面程序 Delphi游戲開發(fā) </li> </ul> </div> </div>
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jquery中Ajax用法總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動畫與特效用法總結(jié)》、《jquery選擇器用法總結(jié)》及《jQuery常用插件及用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計有所幫助。
- jquery仿京東導(dǎo)航/仿淘寶商城左側(cè)分類導(dǎo)航下拉菜單效果
- jQuery仿京東商城樓梯式導(dǎo)航定位菜單
- jQuery模仿京東/天貓商品左側(cè)分類導(dǎo)航菜單效果
- jQuery簡單實現(xiàn)仿京東商城的左側(cè)菜單效果代碼
- Jquery實現(xiàn)仿京東商城省市聯(lián)動菜單
- jquery仿京東側(cè)邊欄導(dǎo)航效果
- 使用jquery菜單插件HoverTree仿京東無限級菜單
- jQuery和CSS仿京東仿淘寶列表導(dǎo)航菜單
- jQuery實現(xiàn)網(wǎng)頁抖動的菜單抖動效果
- jQuery實現(xiàn)仿京東防抖動菜單效果示例
相關(guān)文章
jQuery實現(xiàn)的購物車物品數(shù)量加減功能代碼
這篇文章主要介紹了jQuery實現(xiàn)的購物車物品數(shù)量加減功能,涉及jQuery針對鼠標(biāo)事件的響應(yīng)及頁面元素動態(tài)操作相關(guān)技巧,需要的朋友可以參考下2016-11-11jQuery中bind(),live(),delegate(),on()綁定事件方法實例詳解
這篇文章主要介紹了jQuery中bind(),live(),delegate(),on()綁定事件方法,結(jié)合實例形式詳細(xì)分析了bind(),live(),delegate(),on()方法綁定事件的具體使用技巧,并對比分析了四種方式的異同點,需要的朋友可以參考下2016-01-01淺談jQuery中對象遍歷.eq().first().last().slice()方法
本文給大家分析了jQuery中的對象遍歷.eq().first().last().slice()方法的使用,以及他們之間的區(qū)別,jQuery源碼中的使用。2014-11-11jQuery簡單實現(xiàn)iframe的高度根據(jù)頁面內(nèi)容自適應(yīng)的方法
這篇文章主要介紹了jQuery簡單實現(xiàn)iframe的高度根據(jù)頁面內(nèi)容自適應(yīng)的方法,給出了2種簡單實現(xiàn)方法,涉及jQuery針對頁面高度的動態(tài)獲取與設(shè)置相關(guān)技巧,需要的朋友可以參考下2016-08-08