jQuery復(fù)合事件用法示例
本文實(shí)例講述了jQuery復(fù)合事件用法。分享給大家供大家參考,具體如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>復(fù)合事件</title>
<style type="text/css" >
a{
color:#000;
text-decoration:none;
}
ul{
list-style:none;
}
ul li{
width:140px;
}
#menu_1{
border:1px dotted #666;
border-top:none;
padding:0px 5px 5px 5px;
}
#menu_1 li{
margin: 5px 0px;
}
li.fli{
display:block;
float:left;
padding:0px 10px;
}
</style>
<script src="js/jquery-1.8.3.js" type="text/javascript"></script>
<script language="JavaScript">
$(document).ready(function () {
$("#myaccound").hover(
function () {
$("#menu_1").css("display","block");
},
function () {
$("#menu_1").css("display","none");
});
});
</script>
</head>
<body>
<div id="nav">
<ul>
<li class="fli"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >我的訂單</a></li>
<li class="fli" id="myaccound">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >我的宜美惠▼</a>
<ul id="menu_1" style="display:none;">
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >我的優(yōu)惠券</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >收藏夾</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >短信息</a></li>
</ul>
</li>
<li class="fli"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >我網(wǎng)站導(dǎo)航▼</a></li>
</ul>
</div>
</body>
</html>
運(yùn)行效果圖如下:

PS:這里再附上javascript常見事件與功能說明的在線對(duì)照表供大家參考:
javascript事件與功能說明大全:
http://tools.jb51.net/table/javascript_event
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery常見事件用法與技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery操作json數(shù)據(jù)技巧匯總》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery中復(fù)合屬性選擇器用法實(shí)例
- jQuery 復(fù)合選擇器應(yīng)用的幾個(gè)例子
- jquery中的常用事件bind、hover、toggle等示例介紹
- jquery中交替點(diǎn)擊事件toggle方法的使用示例
- JQuery入門——事件切換之toggle()方法應(yīng)用介紹
- jQuery事件綁定.on()簡(jiǎn)要概述及應(yīng)用
- jQuery給動(dòng)態(tài)添加的元素綁定事件的方法
- jquery鍵盤事件使用介紹
- jQuery事件 delegate()使用方法介紹
- jquery 回車事件實(shí)現(xiàn)代碼
- jQuery復(fù)合事件結(jié)合toggle()方法的用法示例
相關(guān)文章
window.open不被攔截的實(shí)現(xiàn)代碼
打開空白新窗口,再給新窗口的localtion賦值,需要的朋友可以參考下2012-08-08
如何使用CSS3和JQuery easing 插件制作絢麗菜單
這篇文章主要介紹了如何使用CSS3和JQuery easing 插件制作絢麗菜單,這樣做可以讓有菜單的盒子滑出,并且彈出縮略圖。在某些菜單項(xiàng)中我們還包含著有進(jìn)一步鏈接的子菜單。取決于我們鼠標(biāo)在菜單項(xiàng)上的停懸,子菜單將向左或向右滑動(dòng)。,需要的朋友可以參考下2019-06-06
JavaScript中的apply和call函數(shù)詳解
本文是翻譯Function.apply and Function.call in JavaScript,希望對(duì)大家有所幫助2014-07-07
基于jquery實(shí)現(xiàn)頁面滾動(dòng)到底自動(dòng)加載數(shù)據(jù)的功能
這篇文章主要為大家詳細(xì)介紹了基于jquery實(shí)現(xiàn)頁面滾動(dòng)到底自動(dòng)加載數(shù)據(jù)的功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2015-12-12
jquery如何改變html標(biāo)簽的樣式(兩種實(shí)現(xiàn)方法)
對(duì)于如何修飾html標(biāo)簽,這對(duì)于js來說,可以通過setAttribute來設(shè)置標(biāo)簽的屬性,通過getAttribute來得到標(biāo)簽的屬性,而在jq中當(dāng)然也可以實(shí)現(xiàn)類似的功能,方法上肯定比js要簡(jiǎn)化多了,接下來介紹實(shí)現(xiàn)方法,感興趣的朋友可以了解下2013-01-01

