最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

.hover()

Contents:

.hover( handlerIn(eventObject), handlerOut(eventObject) ) 返回: jQuery

描述: 將二個(gè)事件函數(shù)綁定到匹配元素上,分別當(dāng)鼠標(biāo)指針進(jìn)入和離開元素時(shí)被執(zhí)行。

  • version added: 1.0.hover( handlerIn(eventObject), handlerOut(eventObject) )

    handlerIn(eventObject)當(dāng)鼠標(biāo)指針進(jìn)入元素時(shí)觸發(fā)執(zhí)行的事件函數(shù)

    handlerOut(eventObject)當(dāng)鼠標(biāo)指針離開元素時(shí)觸發(fā)執(zhí)行的事件函數(shù)

.hover()方法是同時(shí)綁定 mouseenter.hover()事件。我們可以用它來簡(jiǎn)單地應(yīng)用在鼠標(biāo)在元素上活動(dòng)行為。

調(diào)用$(selector).hover(handlerIn, handlerOut)是以下寫法的簡(jiǎn)寫:

$(selector).mouseenter(handlerIn).mouseleave(handlerOut);

更多細(xì)節(jié)參見.mouseenter().mouseleave()。

Examples:

Example: 當(dāng)鼠標(biāo)在列表中來回滑動(dòng)的時(shí)候添加特殊的樣式, try:

<!DOCTYPE html>
<html>
<head>
  <style>
  ul { margin-left:20px; color:blue; }
  li { cursor:default; }
  span { color:red; }
</style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <ul>
    <li>Milk</li>
    <li>Bread</li>
    <li class='fade'>Chips</li>

    <li class='fade'>Socks</li>
  </ul>
<script>
$("li").hover(
  function () {
    $(this).append($("<span> ***</span>"));
  }, 
  function () {
    $(this).find("span:last").remove();
  }
);



//li with fade class
$("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});

</script>

</body>
</html>

Demo:

Example: 當(dāng)鼠標(biāo)在表格單元格中來回滑動(dòng)的時(shí)候添加特殊的樣式, try:

$("td").hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);

Example: 解除綁定上面的例子中使用:

$("td").unbind('mouseenter mouseleave');

.hover( handlerInOut(eventObject) ) 返回: jQuery

描述: 將一個(gè)單獨(dú)事件函數(shù)綁定到匹配元素上,分別當(dāng)鼠標(biāo)指針進(jìn)入和離開元素時(shí)被執(zhí)行。

  • version added: 1.4.hover( handlerInOut(eventObject) )

    handlerInOut(eventObject)當(dāng)鼠標(biāo)指針進(jìn)入或離開元素時(shí)觸發(fā)執(zhí)行的事件函數(shù)

當(dāng)傳遞個(gè).hover() 方法一個(gè)單獨(dú)的函數(shù)的時(shí)候,將執(zhí)行同時(shí)綁定 mouseenter.hover()事件函數(shù)。這允許在處理函數(shù)中用戶使用jQuery的各種切換方法。

調(diào)用$(selector).hover(handlerInOut)是以下寫法的簡(jiǎn)寫:

$(selector).bind("mouseenter mouseleave",handlerInOut);

更多細(xì)節(jié)參見.mouseenter().mouseleave()

Example:

Slide the next sibling LI up or down on hover, and toggle a class.

<!DOCTYPE html>
<html>
<head>
  <style>
  ul { margin-left:20px; color:blue; }
  li { cursor:default; }
  li.active { background:black;color:white; }
  span { color:red; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <ul>
    <li>Milk</li>
    <li>White</li>
    <li>Carrots</li>
    <li>Orange</li>
    <li>Broccoli</li>
    <li>Green</li>
  </ul>
<script>
$("li")
.filter(":odd")
.hide()
 .end()
.filter(":even")
.hover(
  function () {
    $(this).toggleClass("active")
      .next().stop(true, true).slideToggle();
  }
);


</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
什邡市| 安陆市| 盐亭县| 遵义市| 苍溪县| 凭祥市| 武定县| 富裕县| 阳原县| 舒城县| 鹤壁市| 五常市| 岳西县| 绩溪县| 怀远县| 邹城市| 永善县| 民勤县| 马龙县| 榆中县| 南溪县| 合川市| 陆丰市| 桂阳县| 古丈县| 昌图县| 乌兰察布市| 临潭县| 新乡县| 木兰县| 永善县| 乌海市| 瓦房店市| 宕昌县| 龙海市| 南皮县| 屏东市| 永胜县| 穆棱市| 连平县| 宕昌县|