单击关闭按钮后单击删除相应的图像

编程入门 行业动态 更新时间:2024-10-28 20:21:34
本文介绍了单击关闭按钮后单击删除相应的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

更多推荐

单击关闭按钮后单击删除相应的图像

本文发布于:2023-11-08 11:56:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569306.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   按钮   图像

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!