单击关闭按钮后单击删除相应的图像 [英] Remove respective image onclick of close button

查看:99
本文介绍了单击关闭按钮后单击删除相应的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有编辑列的列表页面.当他单击编辑时,它将打开一个编辑页面,其中包含所有数据的缩略图格式的图像列表. 现在,我在所有图像上都贴上关闭图标.每个图像都有其唯一的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();
}); 

这篇关于单击关闭按钮后单击删除相应的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆