Javascript 通过单击图像使窗口显示出来

Javascript 通过单击图像使窗口显示出来,javascript,html,gallery,image,Javascript,Html,Gallery,Image,因此,我有一系列的图像,如下所示: <div id="gallery-top-picture"><img src= "images/IMG_1786.jpg" width="125" height="125" border="1"></div> <div id="gallery-top-picture"><img src= "images/IMG_2178.jpg" width="125" height="125" border=

因此,我有一系列的图像,如下所示:

   <div id="gallery-top-picture"><img src= "images/IMG_1786.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-top-picture"><img src= "images/IMG_2178.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-top-picture"><img src= "images/IMG_2196.jpg" width="125" height="125" border="1"></div>
  </div>
   <div class="gallery-content">
   <div id= "gallery-bottom-picture"><img src="images/IMG_2214.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-bottom-picture"><img src= "images/IMG_2273.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-bottom-picture"><img src= "images/IMG_2274.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-bottom-picture"><img src= "images/IMG_2277.jpg" width="125" height="125" border="1"></div>
   <div id="gallery-bottom-picture"><img src= "images/IMG_2280.jpg" width="125" height="125" border="1"></div>

我想当我点击其中一个时,另一个虚拟窗口出现在当前窗口的顶部,只有我点击的图像,有人能告诉我如何在javascript上这样做吗?谢谢。

尝试添加此

……例如:

<div id="gallery-top-picture">
    <a href="javascript:void window.open('images/IMG_1786.jpg', 'width=250,height=250,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0');">
        <img src= "images/IMG_1786.jpg" width="125" height="125" border="1"/>
    </a>
</div>

试试这个

$("img").click(function(){
var src = $(this).attr("src");
window.open(src, "Image", "height=200,width=200");});

您也可以这样做,只需根据自己的喜好定制css。单击图像,然后单击背景使其恢复正常


您只需在图像标记上使用此功能即可

您做过任何研究或尝试过任何javascript吗?为什么不使用Lightbox?谢谢cam,我会查看它。。。Sanpopo我找到了,但没有找到我要看的内容我没有很好地解释我,对不起,我真的不想打开一个新的选项卡/窗口本身,我想在整个内容上放置一个图像,淡出其余内容。
onclick="expand(this);"