Light Box
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Jquery Light Box</title> | |
<!-- <script type="text/javascript" src="../jquery-lib.js"></script> --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<style type="text/css"> | |
.center{ | |
margin: 0 auto; | |
} | |
.container{ | |
width: 100%; | |
height: 600px; | |
margin: 0 auto; | |
background-image: url("images/backimg5.jpg"); | |
} | |
#big-photo{ | |
width: 650px; | |
height: 500px; | |
margin-top: 40px; | |
float: left; | |
margin-left: 100px; | |
border:10px solid white; | |
} | |
.bigphoto1{ | |
width: 600px; | |
height: 500px; | |
border:10px solid white; | |
margin-top: 40px; | |
float: left; | |
background-color: red; | |
z-index: 10; | |
} | |
#thumbs{ | |
width: 250px; | |
height: 500px; | |
border: 10px solid white; | |
float: right; | |
margin-top: 40px; | |
position: relative; | |
margin-right: 180px; | |
} | |
.thumbnails img{ | |
width: 100px; | |
margin-left: 15px; | |
margin-top: 17px; | |
float: left; | |
} | |
.thumbsback{ | |
width: 1200px; | |
height: 600px; | |
background-color: black; | |
background-color: rgba(0, 0, 0, 0.4); | |
position: absolute; | |
margin-left: 80px; | |
} | |
.current { | |
opacity: 1; | |
/*background-color: #ffffff;*/ | |
background-color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="thumbsback"> | |
<img id="big-photo" src="images/img1.jpg" ></div> | |
<div id="thumbs"> | |
<div class="thumbnails current" ><img src="images/img1.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img2.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img3.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img4.jpg"/></div> | |
<div class="thumbnails" ><img class="fancybox-thumb" src="images/img5.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img6.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img7.jpg" /></div> | |
<div class="thumbnails" ><img src="images/img8.jpg" /></div> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
$(document).ready(function (){ | |
$('#thumbs .thumbnails').click(function (){ | |
$('#thumbs .thumbnails').removeClass('current'); | |
$(this).addClass('current'); | |
var getThumbSrc = $(this).find('img').attr('src'); | |
$('#big-photo').fadeOut().attr('src', getThumbSrc).fadeIn('slow'); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Comments
Post a Comment