适用于手机端的jQuery图片滑块动画

适用于手机端的jQuery图片滑块动画

在线预览 下载地址

实例代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>适应手机端的jQuery图片滑块动画DEMO演示</title> <link href="https://www.jb51.net/api/jq/5733e37626dcb/css/style.css" /> <script src="https://www.jb51.net/api/jq/5733e37626dcb/js/islider.js"></script> <script src="https://www.jb51.net/api/jq/5733e37626dcb/js/plugins/islider_desktop.js"></script> </head> <body> <!-- 代码 开始 --> <!--<h4>animateType参数中设置,目前支持default, rotate, flip 和 depth, 点击按钮看效果</h4>--> <div> <div></div> </div> <div> <span>default</span> <span>rotate</span> <span>flip</span> <span>depth</span> </div> <h4>垂直轮播</h4> <div></div> <h4>不循环模式(最始及最末图片滑动会有衰减效果)</h4> <div></div> <h4>DOM</h4> <div></div> <script> var picList = [ { width: 150, height: 207, content: "/api/jq/5733e37626dcb/images/1.jpg", }, { width: 150, height: 207, content: "/api/jq/5733e37626dcb/images/2.jpg", }, { width: 150, height: 207, content: "/api/jq/5733e37626dcb/images/3.jpg", }, { width: 150, height: 207, content:"/api/jq/5733e37626dcb/images/5.jpg" }, { width: 150, height: 207, content:"/api/jq/5733e37626dcb/images/6.jpg" }, { width: 300, height: 414, content:"/api/jq/5733e37626dcb/images/7.jpg" }, { width: 150, height: 207, content:"/api/jq/5733e37626dcb/images/8.jpg" }, { width: 150, height: 207, content:"/api/jq/5733e37626dcb/images/9.jpg" } ]; var domList = [ { 'height' : '100%', 'width' : '100%', 'content' : '<div><h1>Home</h1><h2>This is home page</h2><p>home is pretty awsome</p><div>' },{ 'height' : '100%', 'width' : '100%', 'content' : '<div><h1>Page1</h1><h2>This is page1</h2><p>page1 is pretty awsome</p><div>' },{ 'height' : '100%', 'width' : '100%', 'content' : '<div><h1>Page2</h1><h2>This is Page2</h2><p>Page2 is pretty awsome</p><div>' },{ 'height' : '100%', 'width' : '100%', 'content' : '<div><h1>Page3</h1><h2>This is page3</h2><p>page3 is pretty awsome</p><div>' } ]; //all animation effect var islider1 = new iSlider({ data: picList, dom: document.getElementById("animation-effect"), duration: 2000, animateType: 'default', isAutoplay: true, isLooping: true, // isVertical: true, 是否垂直滚动 }); islider1.bindMouse(); //vertical slide var islider2 = new iSlider({ data: picList, dom: document.getElementById("vertical-slide"), duration: 2000, animateType: 'default', isVertical: true, isAutoplay: true, isLooping: true, }); islider2.bindMouse(); //不循环 不自动播放 var islider3 = new iSlider({ data: picList, dom: document.getElementById("non-looping"), animateType: 'default', }); islider3.bindMouse(); //滚动dom var islider4 = new iSlider({ data: domList, dom: document.getElementById("dom-effect"), type: 'dom', animateType: 'default', isAutoplay: true, isLooping: true, }); islider4.bindMouse(); var menu = document.getElementById('menu-select').children; function clickMenuActive(target) { for (var i = 0; i < menu.length; i++) { menu[i].className = ''; } target.className = 'on'; } menu[0].onclick = function() { clickMenuActive(this); islider1._opts.animateType = this.innerHTML; islider1.reset(); }; menu[1].onclick = function() { clickMenuActive(this); islider1._opts.animateType = this.innerHTML; islider1.reset(); }; menu[2].onclick = function() { clickMenuActive(this); islider1._opts.animateType = this.innerHTML; islider1.reset(); }; menu[3].onclick = function() { clickMenuActive(this); islider1._opts.animateType = this.innerHTML; islider1.reset(); }; </script> <!-- 代码 结束 --> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwfxxs.html