多重图片叠加效果 带视觉差效果的轮播图
XML/HTML Code
- <div id="images">
- <div class="lighten">
- <img src="img/lighten1.jpg" alt="" />
- <img src="img/lighten2.jpg" alt="" />
- <img src="img/lighten3.jpg" alt="" />
- </div>
- <div class="normal">
- <img src="img/1.png" alt="" />
- <img src="img/2.png" alt="" />
- <img src="img/3.png" alt="" />
- </div>
- <nav>
- <ul>
- <li class="pre"></li>
- <li class="next"></li>
- </ul>
- </nav>
- </div>
CSS Code
- *{
- margin: 0;
- padding: 0;
- }
- body{
- background: #222;
- }
- #loading{
- color: #fff;
- position: absolute;
- letter-spacing: 3px;
- width: 10em;
- line-height: 2em;
- top: calc(50% - 1em) ;
- left: calc(50% - 5em);
- z-index: 2;
- text-align: center;
- }
- .loading-done{
- display: none;
- }
- #images{
- position: absolute;
- width: 600px;
- left: calc(50% - 300px);
- }
- .canvas{
- position: relative;
- display:block;
- overflow: hidden;
- }
- #images img{
- display: none;
- vertical-align: bottombottom;
- }
- canvas{
- vertical-align: bottombottom;
- position: absolute;
- }
- nav ul{
- height: 0;
- margin: 0;
- }
- nav li {
- position: absolute;
- width: 25px;
- height: 25px;
- opacity: .3;
- list-style: none;
- top: calc(50% - 12px);
- z-index: 100;
- transition: opacity .3s;
- }
- nav li:hover{
- opacity: .7;
- }
- .pre.after-loading{
- left: -40px;
- -webkit-transform: rotate(-45deg);
- transform: rotate(-45deg);
- border-top: 2px solid #000;
- border-left: 2px solid #000;
- }
- .next.after-loading{
- -webkit-transform: rotate(45deg);
- transform: rotate(45deg);
- border-top: 2px solid #000;
- border-right: 2px solid #000;
- rightright: -40px;
- }
原文地址:http://www.freejs.net/article_jiaodiantu_765.html