我无法让可滚动导航工作,当我克隆 DIVS 时它应该触发。我希望在克隆 div 时开始滚动。
任何的想法?
或者
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;
}
});