大家好我有这个scripts
而我想追加只发生六次
$(".upload_add").click(function(){
$("#film_upload_side")
.append('<div class="photo_upload_button"> Shoose file to upload</div>');
});
答案 0 :(得分:8)
设置一个计数器:
var counter = 0;
$(".upload_add").click(function(){
counter++;
if(counter<7)
$("#film_upload_side").append('<div class="photo_upload_button"> Shoose file to upload</div>');
});
答案 1 :(得分:3)
var flag = 0;
$(".upload_add").click(function(){
flag++;
if(flag<=6)
$("#film_upload_side").append('<div class="photo_upload_button"> Shoose file to upload</div>');
});
当它变为6时检查标志,然后停止追加。