2012-04-16 91 views
0

我無法使滾動導航工作,當我克隆DIVS 時應該觸發。我想要在div被克隆時開始滾動。jquery-tools上的導航可滾動始終禁用

有什麼想法嗎?

http://jsfiddle.net/2mby5/13/

var cloneCount = 0; 
$("#add-address").click(function() { 

    $("#to-add-address").clone() 
     .attr("id", "to-add-address_Clone" + cloneCount) 
     .insertAfter("#to-add-address").addClass('cloned'); //add a new class cloned to the cloned outerDivs 
    $(".clone", "#to-add-address_Clone" + cloneCount) 
     .attr("id", "clone_Clone" + cloneCount); 
    cloneCount++; 
    $('#scroll-addresses').scrollable(); 
}); 



$(document).on("click", '.options li a',function() { 
      $(this).closest(".options").find('li a').removeClass('selected'); 
      $(this).addClass('selected'); 

     }); 
$(document).on("click", 'li.delete',function() { 
      $(this).closest(".outerDiv").filter('.cloned').remove(); // and delete only the cloned ones 
    if ($(this).is(".outerDiv:last")){ 
      return false; 
    } 
}); 

​ 

回答

0

「你必須爲滾動和內,對於項目的另一個包裝元素根元素。」

http://jquerytools.org/demos/scrollable/index.html

+0

真的不能找到的差異,看起來好像沒什麼問題。 – DD77 2012-04-16 14:58:47

+0

感謝您的留言,但我無法真正做到這一點,請問您可以幫我查一下嗎? – DD77 2012-04-16 15:06:22

+0

嘗試鋪設你的代碼就像例子,看它是否工作,然後根據需要調整。 – servarevitas3 2012-04-16 15:32:25