基于jQuery商城网站全屏图片切换代码。这是一款商城网站全屏多张图片滑动切换代码。效果图如下:
实现的代码。
html代码:
<div class="slides"> <div class="slideInner"> <a href="#" style="background: url(img/slide1.jpg) no-repeat;"> <div class="moveElem img1" rel="0,easeInOutExpo"> <img src="img/slide1p1.png" /> </div> <div class="moveElem img2" rel="150,easeInOutExpo"> <img src="img/slide1p2.png" /> </div> </a><a href="#" style="background: url(img/slide2.jpg) no-repeat"> <div class="moveElem img1" rel="0,easeInOutExpo"> <img src="img/slide2p1.png" /> </div> </a><a href="#" class="slide3" style="background: url(img/slide3.jpg) no-repeat;"> <div class="moveElem img1" rel="0,easeInOutExpo"> <img src="img/slide3p1.png" /> </div> <div class="moveElem img2" rel="150,easeInOutExpo"> <img src="img/slide3p2.png" /> </div> <div class="moveElem img3" rel="300,easeInOutExpo"> <img src="img/slide3p3.png" /> </div> </a><a href="#" style="background: rgb(113, 209, 231);"> <div class="moveElem img1" rel="0,easeInOutExpo"> <img src="img/slide1p1.png" /> </div> <div class="moveElem img2" rel="150,easeInOutExpo"> <img src="img/slide1p2.png" /> </div> </a><a href="#" style="background: rgb(178, 44, 44);"> <div class="moveElem img1" rel="0,easeInOutExpo"> <img src="img/slide1p1.png" /> </div> <div class="moveElem img2" rel="150,easeInOutExpo"> <img src="img/slide1p2.png" /> </div> </a> </div> <div class="nav"> <a class="prev" href="javascript:;"></a><a class="next" href="javascript:;"></a> </div> </div>
js代码:
$(document).ready(function () { $(".slideInner").slide({ slideContainer: $('.slideInner a'), effect: 'easeOutCirc', autoRunTime: 5000, slideSpeed: 1000, nav: true, autoRun: true, prevBtn: $('a.prev'), nextBtn: $('a.next') }); });