我有一个带有编辑列的列表页面.当他单击编辑时,它将打开一个编辑页面,其中包含所有数据的缩略图格式的图像列表. 现在,我在所有图像上都贴上关闭图标.每个图像都有其唯一的ID.
I have a one list page with edit column. When he click on edit it will open one edit page with all data which have list of image in thumbnail format. Now I put close icon to all images.each image have its unique id.
1)当我单击关闭图标时,它将隐藏并删除相应的图像.
1) When I click on close icon it will hide remove respective image.
2)onclick提交时我想要可用的图像ID.
2) onclick of submit I want available image ids.
PHP代码:-
<div id="<?=$rw['id'];?>" style="height:68px; width:86px; margin-right:10px; float:left;"> <img src="img/icons/close.png" style="float:right; vertical-align:top; height:18px; width:18px; z-index:9999;" > <div style="height:50px; width:70px; border:1px solid #999; float:left; margin: 0 10px 0 0; box-shadow: 0 0 1px 1px #888888;"> <a class="group<?=$i;?>" href="<?=$img_gpath;?><?=$rw['upload_url'];?>" title=""> <img src="<?=$img_gpath.$rw['upload_url'];?>" style="height:50px; width:70px; z-index:999;" id="<?=$i;?>"> </a> </div> </div>如果您有任何解决方案,请与我分享.
Please if you have any solution then share it with me.
推荐答案创建了一个示例小提琴 .请检查.
An example fiddle is created. Please check.
请为删除按钮提供remove-img类.
<img class="remove-img" src="url" />然后,您需要在点击删除图片后删除父分区,例如:
Then you need to remove the parent division on click of the remove image like:
$('.remove-img').click(function(e) { $( this ).parent().remove(); });更多推荐
单击关闭按钮后单击删除相应的图像
发布评论