کدش رو نوشتم بررسی کنید هرجا مشکل داشتید بپرسید.
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
*{
margin: 0;
padding: 0;
}
html,
body,
.gallery,
.content,
.grid,
.slidshow,
.slidshow .img{
display: block;
height: 100%;
width: 100%;
}
.gallery{
position: relative;
overflow: hidden;
}
.content{
position: absolute;
left: 0;
width: 200%;
}
.grid,
.slidshow{
position: relative;
float: left;
}
.slidshow .img img{
max-width: 100%;
height: auto;
}
.slidshow .close{
position: absolute;
display: block;
height: 48px;
width: 48px;
border-radius: 50%;
background-color: rgba(0, 0, 0, .5);
line-height: 48px;
text-align: center;
color: #fff;
right: 50px;
top: 50px;
text-decoration: none;
font-size: 22px;
transition: all .2s ease-in-out;
}
.slidshow .close:before{
content: "×";
}
.slidshow .close:hover{
background-color: rgba(0, 0, 0, .8);
transform: rotate(90deg);
}
.block{
display: block;
height: 150px;
width: 20%;
position: relative;
overflow: hidden;
float: left;
}
.block,
.block *{
padding: 0;
margin: 0;
box-sizing: border-box;
}
.block img{
position: absolute;
top: 0;
left: 0;
height: 150px;
width: 100%;
z-index: 1;
transition: all .3s ease-in-out;
}
.block.hover img,
.block:hover img{
transform: scale(1.25);
}
.block div{
display: block;
height: 150px;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 2;
color: #fff;
text-align: center;
background-color: rgba(0, 0, 0, 0);
transition: all .3s ease-in-out;
}
.block.hover div,
.block:hover div{
background-color: rgba(0, 0, 0, .5);
}
.block h3{
display: block;
max-width: 170px;
border: 1px solid #fff;
padding: 5px;
margin: 0 auto;
margin-top: 40px;
transition: all .3s ease-in-out;
transform: scale(3);
opacity: 0;
}
.block p{
display: block;
color: #eee;
margin-top: 10px;
transition: all .3s ease-in-out;
transform: scale(3);
opacity: 0;
}
.block p i{
color: #ccc;
}
.block.hover h3,
.block:hover h3,
.block.hover p,
.block:hover p{
transform: scale(1);
opacity: 1;
}
</style>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script>
$(function () {
function ww() {
return $(window).width();
}
function responsive() {
$('.grid, .slidshow').css({'width': ww()});
}
responsive();
$(window).resize(function () {
responsive();
});
$(document).on('click', '.grid a', function (e) {
e.preventDefault();
var block = $(this);
var description = block.find('p').html();
block.addClass('hover');
block.find('p').html('<i>Loading ...</i>');
var zoom = block.find('img').data('zoom');
$('.slidshow .img').html('<img src="' + zoom + '">');
$('.slidshow .img img').load(function () {
$('.gallery .content').animate({'left': -ww()}, 1000, 'easeInQuint', function () {
block.find('p').html(description);
block.removeClass('hover');
});
});
});
$(document).on('click', '.gallery .close', function (e) {
e.preventDefault();
$('.gallery .content').animate({'left': 0}, 1000, 'easeInQuint');
});
});
</script>
</head>
<body>
<div class="gallery">
<div class="content">
<div class="grid">
<a href="#" class="block">
<img src="http://www.nicolastarierphotography.com/photos/small/26.jpg" data-zoom="http://www.nicolastarierphotography.com/photos/zoom/26.jpg" alt=""/>
<div>
<h3>Title</h3>
<p>Description</p>
</div>
</a>
<a href="#" class="block">
<img src="http://www.nicolastarierphotography.com/photos/small/27.jpg" data-zoom="http://www.nicolastarierphotography.com/photos/zoom/27.jpg" alt=""/>
<div>
<h3>Title</h3>
<p>Description</p>
</div>
</a>
</div>
<div class="slidshow">
<a class="close" href="#"></a>
<div class="img"></div>
</div>
</div>
</div>
</body>
</html>
...