【发布时间】:2012-05-07 04:24:31
【问题描述】:
我要存档的是克隆我的“盒子”,并有一个没有值的克隆。 所以输入应该是空的。 我有这个小提琴,只有函数和 html。 希望很明确,你们可以帮助我。
http://jsfiddle.net/XeELs/117/
addAddress: function() {
var cloneCount = 0;
$copy = $("#scroll .first").first().clone().attr("id", "to-add-first_Clone" + cloneCount).addClass('cloned'); //add a new class cloned to the cloned outerDivs
$(".clone", "#to-add-first_Clone" + cloneCount).attr("id", "clone_Clone" + cloneCount);
cloneCount++;
//check breakpoints
var $last_bp = $('#scroll .wrap .breakpoint').last();
var $first = $(".first", $last_bp).length;
if ($first > 2) {
//move this into a new breakpoint
$('#scroll .wrap').append('<div class="breakpoint"/>');
$last_bp = $('#scroll .wrap .breakpoint').last();
}
$last_bp.append($copy);
this.drawNavigation();
},
【问题讨论】: