Forum Moderators: open
function change_image(image)
{
$(".overlay").show();
$(".box").show("slow");
$("#" + image).fadeIn(1000);
$(".close_button").show();
$(".close_button").click(function() {
$(this).hide();
$("#" + image).fadeOut("fast");
$(".box").hide("slow");
$(".overlay").hide("slow");
});
}
</script>
...
<div class="thumb_container">
<div class="thumbnail">
<a href="javascript:void(0);" class="full_image"><img src="images/faith_thumb_1.jpg" alt="" style="border:0" onClick="change_image('big_image_1')"></a> </div><!-- END OF thumbnail 1-->
<div class="thumbnail">
<a href="javascript:void(0);" class="full_image"><img src="images/faith_thumb_2.jpg" alt="" style="border:0" onClick="change_image('big_image_2')"></a> </div><!-- END OF thumbnail 2-->
...
<div class="standalone_image"><!-- BOX FOR THE IMAGE-->
<img src="images/faith_full_1.jpg" alt="" style="display:none" id="big_image_1">
<img src="images/faith_full_2.jpg" alt="" style="display:none" id="big_image_2">
...
/* FOR THE IMAGES POP UP WINDOW */
.overlay
{
display:none;
background:#cf1dbb;
opacity:0.75;
filter:alpha(opacity=75); /* For IE8 and earlier */
top:0px;
bottom:0px;
left:0px;
right:0px;
position:fixed;
z-index:100;
}
.box
{
display:none;
background-color:black;
width:660px;
height:450px;
position:fixed;
left:50%;
margin: -215px 0 0 -330px; /* to centre a fixed div just give it left 50% and move it back half of its width*/
/*top:10%;*/
top:50%;
z-index:101;
}
.standalone_image
{
/*background:url(../images/water_full_3.jpg) no-repeat;*/
position:absolute;
z-index:101;
width:602px;
height:399px;
top:25.5px;
bottom:25.5px
left:29px;
right:29px;
/*border:1px solid red;*/
}
.close_button
{
display:none;
left:94%;
/*background:url(../images/close_button.png);*/
width:40px;
height:40px;
position:absolute;
z-index:102;
}
...
$("#" + image).hide();
$(".box").hide();
$(".overlay").hide();
* html .box {
position: absolute;
}