如何在点击该图像时获得弹出窗口上的图像? [英] How to get image on popup on click of that image?

查看:56
本文介绍了如何在点击该图像时获得弹出窗口上的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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",


这篇关于如何在点击该图像时获得弹出窗口上的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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