如何在点击该图像时获得弹出窗口上的图像?
问题描述:
我在div中创建了多个图像。如果点击任何图像,那么该图像将显示在另一个div中。(我已经得到了这个)。但是如果我点击图像然后它将在弹出窗口中显示。
如何在弹出窗口中显示图像点击那个图像。
I have created multiple images in div. if any image is clicked then that image will show in another div.(i have got this).but if i clicked image then it will show in popup.
how to show image in popup on click of that image.
答
这是一个基本的想法,你可以根据需要解决它。
This is a basic idea, you can workaround it according to your need.
<div class="popup">
<img src="" alt="" />
</div>
<style>
.popup{
position:fixed;
top:10%;
left: 40%;
height:400px;
width: 600px;
background:color:#fff;
padding:15px;
box-shadow: 3px 3px 5px #aaa;
display: none;
}
.popup img{
height:100%;
width:100%;
}
</style>
<script>
( .yourDiv img)。click( function (){
(".yourDiv img").click(function() {
( 。popup img)。attr( src,
(".popup img").attr("src",