-1
我有下面的代碼:jQuery的克隆多.find()函數
HTML:
<ul>
<li id="clonedInput0">
<label>
<input type="file" accept="image/*" name="image_gallery[]" id="image_gallery"
class="image_gallery" style="display:none;" data-gallery="0">
<p>Select image</p>
<div class="img_src"></div>
<div class="overlay-image" style="display:none;"><i class="fa fa-circle-o-notch fa-spin"></i></div>
</label>
</li>
<div id="add_more" class="add-more"><img src="<?php echo get_template_directory_uri()?>/images/guateworks/add_image.png" alt="" width="50" /></div>
</ul>
的jQuery:
var cloned = jQuery(".photos ul li:first-child").clone()
.insertBefore(this)
.attr("id", "clonedInput" + cloneIndex)
.find("#image_gallery").removeAttr('data-gallery').attr('data-gallery',cloneIndex)
.find('.img_src').remove();
但不起作用。任何人知道爲什麼?
請張貼HTML以及 – GraveyardQueen
@GraveyardQueen我只是說這 –
什麼並不瞭解它的工作? –