2012-09-14 42 views
2

我在想如果有人知道如何自動推進無線電輸入?基本上有一個無線電檢查,然後檢查下一個間隔等JQuery - 自動推進無線電輸入「已檢查」

這已經真的踢我的屁股。這是我到目前爲止。

$("#image_box > :input:gt(0)").attr("checked",true); 
    setInterval(function() { 
     $("#image_box > :input:first") 
      .next() 
      .end() 
      .append().attr("checked",true); 
     }, 3000); 
+1

你能提供一些HTML代碼?更好,如果你可以讓[JsFiddle](http://jsfiddle.net) – Touki

+0

我想自動推進這[鏈接](http://tympanus.net/codrops/2012/04/30/fluid-css3 -slideshow-with-parallax-effect /) – Django

回答

2

試試這個。每秒都會檢查下一個電臺。

var $radios = $('input[type=radio]'); 
$radios.each(function(i, e) { 
    setTimeout(function(){ 
    $(e).prop('checked', true); 
    }, 1000 * i); 
}); 

演示:http://jsbin.com/oqubis/1/edit

+0

+1瞭解問題。 [這是一個改進](http://jsbin.com/oqubis/2/edit) – Touki

+0

太棒了!謝謝。我會嘗試 – Django

相關問題