jQuery簡(jiǎn)單實(shí)現(xiàn)仿京東分類導(dǎo)航層效果
本文實(shí)例講述了jQuery簡(jiǎn)單實(shí)現(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); //要浮動(dòng)在這個(gè)元素旁邊的層
div.css("position", "absolute"); //讓這個(gè)層可以絕對(duì)定位
var self = $(this); //當(dāng)前對(duì)象
div.css("display", "block");
var p = self.position(); //獲取這個(gè)元素的left和top
var x = p.left + self.width(); //獲取這個(gè)浮動(dòng)層的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); //要浮動(dòng)在這個(gè)元素旁邊的層
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基本語(yǔ)法 php實(shí)例
</li>
</ul>
<ul class="unfocus">
<li ><strong>java</strong> <br />
java語(yǔ)法 java面向?qū)ο?
</li>
</ul>
<ul class="unfocus">
<li ><strong>Python</strong> <br />
Python語(yǔ)法 Python圖形處理
</li>
</ul>
<ul class="unfocus">
<li ><strong>javascript</strong> <br />
javascript幻燈片 javascript網(wǎng)頁(yè)特效
</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)程序開(kāi)發(fā) VC++網(wǎng)絡(luò)程序
</li>
</ul>
<ul class="unfocus">
<li ><strong>Delphi</strong> <br />
Delphi桌面程序 Delphi游戲開(kāi)發(fā)
</li>
</ul>
</div>
</div>
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jquery中Ajax用法總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見(jiàn)經(jīng)典特效匯總》、《jQuery動(dòng)畫(huà)與特效用法總結(jié)》、《jquery選擇器用法總結(jié)》及《jQuery常用插件及用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jquery仿京東導(dǎo)航/仿淘寶商城左側(cè)分類導(dǎo)航下拉菜單效果
- jQuery仿京東商城樓梯式導(dǎo)航定位菜單
- jQuery模仿京東/天貓商品左側(cè)分類導(dǎo)航菜單效果
- jQuery簡(jiǎn)單實(shí)現(xiàn)仿京東商城的左側(cè)菜單效果代碼
- Jquery實(shí)現(xiàn)仿京東商城省市聯(lián)動(dòng)菜單
- jquery仿京東側(cè)邊欄導(dǎo)航效果
- 使用jquery菜單插件HoverTree仿京東無(wú)限級(jí)菜單
- jQuery和CSS仿京東仿淘寶列表導(dǎo)航菜單
- jQuery實(shí)現(xiàn)網(wǎng)頁(yè)抖動(dòng)的菜單抖動(dòng)效果
- jQuery實(shí)現(xiàn)仿京東防抖動(dòng)菜單效果示例
相關(guān)文章
jQuery實(shí)現(xiàn)級(jí)聯(lián)下拉框?qū)崙?zhàn)(5)
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)級(jí)聯(lián)下拉框的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-02-02
jquery UI實(shí)現(xiàn)autocomplete在獲取焦點(diǎn)時(shí)得到顯示列表功能示例
這篇文章主要介紹了jquery UI實(shí)現(xiàn)autocomplete在獲取焦點(diǎn)時(shí)得到顯示列表功能,結(jié)合實(shí)例形式分析了jquery UI實(shí)現(xiàn)autocomplete事件響應(yīng)及顯示下拉列表功能操作技巧,需要的朋友可以參考下2019-06-06
Validform驗(yàn)證時(shí)可以為空否則按照指定格式驗(yàn)證
這篇文章主要介紹了Validform驗(yàn)證時(shí)可以為空否則按照指定格式驗(yàn)證的相關(guān)資料,需要的朋友可以參考下2017-10-10
jquery中用函數(shù)來(lái)設(shè)置css樣式
本文主要對(duì)jquery中用函數(shù)來(lái)設(shè)置css樣式的方法進(jìn)行詳細(xì)介紹,具有很好的參考價(jià)值,下面就跟小編一起來(lái)看下吧2016-12-12
jquery亂碼與contentType屬性設(shè)置問(wèn)題解決方案
讓人頭痛的Jquery亂碼問(wèn)題。其實(shí)這方面文章已經(jīng)很多了,但全面解決各種問(wèn)題的很少,今天總結(jié)一下,方便自己也方便大家,感興趣的朋友可以了解下哦2013-01-01
JQuery復(fù)制DOM節(jié)點(diǎn)的方法
這篇文章主要介紹了JQuery復(fù)制DOM節(jié)點(diǎn)的方法,涉及jQuery中clone與appendTo方法的使用技巧,需要的朋友可以參考下2015-06-06
jquery 學(xué)習(xí)之一 對(duì)象訪問(wèn)
jquery 學(xué)習(xí)之一 對(duì)象訪問(wèn)整理,學(xué)習(xí)jquery的朋友可以參考下。2010-11-11
jQuery對(duì)象與DOM對(duì)象之間的相互轉(zhuǎn)換
本文主要給大家介紹的是jQuery對(duì)象與DOM對(duì)象之間的相互轉(zhuǎn)換的方法和示例,非常實(shí)用,這里推薦給有需要的小伙伴參考下。2015-03-03

