問題:我想做一個獲得()但只有不元素.played類。 (我正在建立一個shuffle播放列表,播放的數字正在標記。在他們的div上播放類)。JQuery的過濾後獲得()
當前代碼:
var randomElements = $("#playlistVideos").get();
我試了一下:過濾器()和大量的選擇技巧的,他們沒有成功。我對你將如何解決這樣的問題非常感興趣!
HTML:
<div id="playlistVideos">
<div class="vt ddsitem">
<a href="javascript:loadAndPlayVideo('wQ5iFQv1KaE')"><img class="pt" id="wQ5iFQv1KaE" src="http://i.ytimg.com/vi/wQ5iFQv1KaE/default.jpg"></a>
<div>
<img style="width: 18px; height: 18px; position: relative; left: 100px; bottom: 98px;" class="updown" src="images/updown.gif"><a style="cursor: pointer;" href="javascript:deleteVideo('wQ5iFQv1KaE')"><img style="width: 18px; height: 18px; position: relative; left: 150px; bottom: 98px; cursor: pointer;" class="bin" src="images/bin.gif"></a>
</div>
</div>
<div class="vt ddsitem">
<a href="javascript:loadAndPlayVideo('Ya3_wQpzDIU')"><img class="pt" id="Ya3_wQpzDIU" src="http://i.ytimg.com/vi/Ya3_wQpzDIU/default.jpg"></a>
<div>
<img style="width: 18px; height: 18px; position: relative; left: 100px; bottom: 98px;" class="updown" src="images/updown.gif"><a style="cursor: pointer;" href="javascript:deleteVideo('Ya3_wQpzDIU')"><img style="width: 18px; height: 18px; position: relative; left: 150px; bottom: 98px; cursor: pointer;" class="bin" src="images/bin.gif"></a>
</div>
</div>
<div class="vt ddsitem played">
<a href="javascript:loadAndPlayVideo('Dq0hrmT7JiQ')"><img class="pt" id="Dq0hrmT7JiQ" src="http://i.ytimg.com/vi/Dq0hrmT7JiQ/default.jpg"></a>
<div>
<img style="width: 18px; height: 18px; position: relative; left: 100px; bottom: 98px;" class="updown" src="images/updown.gif"><a style="cursor: pointer;" href="javascript:deleteVideo('Dq0hrmT7JiQ')"><img style="width: 18px; height: 18px; position: relative; left: 150px; bottom: 98px; cursor: pointer;" class="bin" src="images/bin.gif"></a>
</div>
</div>
<div class="vt ddsitem">
<a href="javascript:loadAndPlayVideo('WklNzfvit9E')"><img class="pt" id="WklNzfvit9E" src="http://i.ytimg.com/vi/WklNzfvit9E/default.jpg"></a>
<div>
<img style="width: 18px; height: 18px; position: relative; left: 100px; bottom: 98px;" class="updown" src="images/updown.gif"><a style="cursor: pointer;" href="javascript:deleteVideo('WklNzfvit9E')"><img style="width: 18px; height: 18px; position: relative; left: 150px; bottom: 98px; cursor: pointer;" class="bin" src="images/bin.gif"></a>
</div>
</div>
Thnx Andy E爲您的反應! – MeProtozoan 2010-09-20 14:17:24
@MeProtozoan:沒問題。順便說一句,我真的很喜歡你的格式,所以我早點投了票。很少有人看到一個相對較新的用戶投入這種努力。 – 2010-09-20 15:08:52