Click here to Skip to main content
15,910,121 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Suvendu Shekhar Giri 5-Oct-15 4:05am    
Share what you've tried so far?
Hussain Javed 5-Oct-15 4:23am    
i want to popup this image onclick using jquery or javascript
<div style="height:65px;border:solid 1px #999;">

<img src="images/startdesign images/img7.png" id="fabric" height="63" width="401"/>
</div>
can you give any working example for this

Check this -
http://jsfiddle.net/SzR6h/25/[^]
If you want this kind of functonality check this thread in StackOverflow
http://stackoverflow.com/a/10910799/1006297[^]

Also, you may want to visit this discussion-
jQuery: How can I show an image popup onclick of the thumbnail?[^]

Hope, it helps :)
 
Share this answer
 
Comments
Hussain Javed 5-Oct-15 5:40am    
can you give any working example for this?
Hussain Javed 5-Oct-15 5:57am    
please refer http://www.houseofblouse.com/design/u-neck-2
there is image in div onclick it show in popup
This is a basic idea, you can workaround it according to your need.
HTML
<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() {
    $(".popup img").attr("src", $(this).attr("src"));
    $(".popup").show();
});
</script>


-KR
 
Share this answer
 
Comments
Hussain Javed 5-Oct-15 4:16am    
can you give any working example for this?
Krunal Rohit 5-Oct-15 4:36am    
Can't you try this ?
If you read my answer carefully, then I have said that it's basic idea.

-KR
Hussain Javed 5-Oct-15 5:56am    
please refer http://www.houseofblouse.com/design/u-neck-2
there is image in div onclick it show in popup

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900