一款非常有创意的jQuery+css3相册图片叠加堆放展开动画特效,图片层叠放置布局效果,点击图片滑动展开,点击展开的图片点击则会滑动收缩起来。一款非常有创意的jQuery+css3相册图片叠加堆放展开动画特效,图片层叠放置布局效果,点击图片滑动展开,点击展开的图片点击则会滑动收缩起来,先来看看效果:
一部分关键的代码如下:
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery+css3相册图片叠加堆放展开动画特效</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body><script src="/demos/googlegg.js"></script>
<ul class="cards">
<li class="title">
<h2>Slide right</h2>
</li>
<li class="card card-1"><img src="img/01.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-2"><img src="img/02.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-3"><img src="img/03.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Card description</p>
</div>
</li>
</ul>
<hr/>
<ul class="card-stacks">
<li class="title">
<h2>Expand to grid</h2>
</li>
<li class="stack stack-1">
<ul class="cards-down">
<li class="card card-1"><img src="img/04.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Stack 1</p>
</div>
</li>
<li class="card card-2"><img src="img/05.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Stack 1</p>
</div>
</li>
<li class="card card-3"><img src="img/06.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Stack 1</p>
</div>
</li>
</ul>
</li>
<li class="stack stack-2">
<ul class="cards-down">
<li class="card card-1"><img src="img/07.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Stack 2</p>
</div>
</li>
<li class="card card-2"><img src="img/08.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Stack 2</p>
</div>
</li>
<li class="card card-3"><img src="img/01.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Stack 2</p>
</div>
</li>
</ul>
</li>
<li class="stack stack-3">
<ul class="cards-down">
<li class="card card-1"><img src="img/06.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Stack 3</p>
</div>
</li>
<li class="card card-2"><img src="img/02.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Stack 3</p>
</div>
</li>
<li class="card card-3"><img src="img/03.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Stack 3</p>
</div>
</li>
</ul>
</li>
</ul>
<hr/>
<ul class="cards-split">
<li class="title">
<h2>Split from middle</h2>
</li>
<li class="card card-1"><img src="img/02.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-2"><img src="img/04.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-3"><img src="img/06.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Card description</p>
</div>
</li>
</ul>
<hr/>
<ul class="cards-split-delay">
<li class="title">
<h2>Delayed split from middle</h2>
</li>
<li class="card card-1"><img src="img/01.jpg">
<div class="content">
<h1>Card 1 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-2"><img src="img/05.jpg">
<div class="content">
<h1>Card 2 Title</h1>
<p>Card description</p>
</div>
</li>
<li class="card card-3"><img src="img/08.jpg">
<div class="content">
<h1>Card 3 Title</h1>
<p>Card description</p>
</div>
</li>
</ul>
<script type="text/javascript" src='js/jquery-1.10.2.min.js'></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('ul.cards').on('click', function () {
$(this).toggleClass('transition');
});
$('ul.card-stacks').on('click', function () {
$(this).toggleClass('transition');
});
$('ul.cards-split').on('click', function () {
$(this).toggleClass('transition');
});
$('ul.cards-split-delay').on('click', function () {
$(this).toggleClass('transition');
});
});
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>适用浏览器:360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p>
<p>来源:<a href="http://www.lanrenzhijia.com/" target="_blank">懒人</a></p>
</div>
</body>
</html>
全部代码:jQuery+css3相册图片叠加堆放展开动画特效