Jquery 无法取消隐藏单个图像

Jquery 无法取消隐藏单个图像,jquery,Jquery,我是jquery新手,我想请求您支持如何从另一个div中取消隐藏单个图像。因为我隐藏了所有标记的,我想取消隐藏单个图像以便于描述。为您的图像提供Id并取消隐藏它 <img id="image1" src="...."/> $('#image1').show() $('#image1').show() 您可以使用下面的代码片段 $("#imageDivId").show(); 您还可以使用div class而不是id $(".imageDivClass").show();

我是jquery新手,我想请求您支持如何从另一个div中取消隐藏单个图像。因为我隐藏了所有标记的
,我想取消隐藏单个图像以便于描述。

为您的图像提供Id并取消隐藏它

<img id="image1" src="...."/>


$('#image1').show()

$('#image1').show()

您可以使用下面的代码片段

$("#imageDivId").show();
您还可以使用div class而不是id

 $(".imageDivClass").show();
还可以使用toggle()方法在hide()和show()方法之间切换


如果使用ID可以使用
$(“#img_ID”).show()

如果使用可以使用
$('.img_class').show()

如果使用ID为的父div作为目标img,则可以使用
$(“#div_ID img”).show()


对于jQuery,您也可以使用jQuery来显示/隐藏img,具体取决于它是否可见。

您需要指定需要显示的图像:

<img src="http://placehold.it/50x50" />
<img src="http://placehold.it/50x50" />
<img src="http://placehold.it/50x50" />
<div id="show"><img src="http://placehold.it/50x50" /></div>

$('img').hide();
$('#show img').show();

$('img').hide();
$('#show img').show();

Fiddle:

HTML是什么样子的。以及隐藏图像的代码。你可以说类似于
$('#yourmageid').show()的话为了帮助您,请提供您的代码以及您在JSFIDLE上尝试过的内容和/或演示。其中一些答案对您有用吗?
<img src="http://placehold.it/50x50" />
<img src="http://placehold.it/50x50" />
<img src="http://placehold.it/50x50" />
<div id="show"><img src="http://placehold.it/50x50" /></div>

$('img').hide();
$('#show img').show();