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

jQuery.unique()

jQuery.unique( array ) 返回: Array

描述: 刪除數(shù)組中重復(fù)元素。只處理刪除DOM元素?cái)?shù)組,而不能處理字符串或者數(shù)字?jǐn)?shù)組。

  • version added: 1.1.3jQuery.unique( array )

    arrayDOM元素的數(shù)組。

$.unique()函數(shù)通過(guò)搜索的數(shù)組對(duì)象,排序數(shù)組,并移除任何重復(fù)的節(jié)點(diǎn)。此功能只適用于普通的JavaScript DOM元素的數(shù)組,主要是jQuery內(nèi)部使用。

在jQuery 1.4中結(jié)果將始終按文檔順序返回。

Example:

Removes any duplicate elements from the array of divs.

<!DOCTYPE html>
<html>
<head>
  <style>
  div { color:blue; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <div>There are 6 divs in this document.</div>
  <div></div>
  <div class="dup"></div>
  <div class="dup"></div>

  <div class="dup"></div>
  <div></div>
<script>

    var divs = $("div").get(); // unique() must take a native array

    // add 3 elements of class dup too (they are divs)
    divs = divs.concat($(".dup").get());
    $("div:eq(1)").text("Pre-unique there are " + divs.length + " elements.");

    divs = jQuery.unique(divs);
    $("div:eq(2)").text("Post-unique there are " + divs.length + " elements.")
                  .css("color", "red");

</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
兴海县| 黎平县| 大理市| 陕西省| 汾阳市| 册亨县| 十堰市| 凌海市| 东城区| 凤台县| 门源| 吉木萨尔县| 柞水县| 新建县| 贵德县| 招远市| 岐山县| 临颍县| 仁化县| 永福县| 海城市| 横峰县| 河间市| 城市| 福贡县| 漳州市| 乳源| 桐柏县| 青川县| 青川县| 青川县| 长垣县| 固阳县| 大兴区| 孟津县| 兴和县| 临海市| 万州区| 福安市| 外汇| 如皋市|