-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();
しかし、動作しませんが。誰にも分かりますか?
私はちょうどそれについては動作しません何 – GraveyardQueen
HTMLを投稿してください? –
これを追加しました@GraveyardQueen同様 –