<!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>图片轮播</title> <meta name="renderer" content="webkit"> <meta http-equiv="Cache-Control" content="no-siteapp"/> <link rel="icon" type="image/png" href="assets/i/favicon.png"> <meta name="mobile-web-app-capable" content="yes"> <link rel="icon" sizes="192x192" href="assets/i/[email protected]"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="Amaze UI"/> <link rel="apple-touch-icon-precomposed" href="assets/i/[email protected]"> <meta name="msapplication-TileImage" content="assets/i/[email protected]"> <meta name="msapplication-TileColor" content="#0e90d2"> <link rel="stylesheet" href="assets/css/amazeui.min.css"> </head> <body> <div class="am-slider am-slider-default" data-am-flexslider id="demo-slider-0"> <ul class="am-slides"> <li><img src="http://s.amazeui.org/media/i/demos/bing-1.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/bing-2.jpg" /></li> </ul> </div> <div class="am-btn-toolbar"> <button type="button" class="am-btn am-btn-primary js-demo-slider-btn" data-action="add">添加 slide</button> <button type="button" class="am-btn am-btn-danger js-demo-slider-btn" data-action="remove">移除 slide</button> </div> <!--[if (gte IE 9)|!(IE)]><!--> <script src="assets/js/jquery.min.js"></script> <!--<![endif]--> <!--[if lte IE 8 ]> <script src="assets/ie8/jquery.min.js"></script> <script src="assets/ie8/modernizr.js"></script> <script src="assets/js/amazeui.ie8polyfill.min.js"></script> <![endif]--> <script src="assets/js/amazeui.min.js"></script> <script> $(function() { var $slider = $('#demo-slider-0'); var counter = 0; var getSlide = function() { counter++; return '<li><img src="http://s.amazeui.org/media/i/demos/bing-' + (Math.floor(Math.random() * 4) + 1) + '.jpg" />' + '<div class="am-slider-desc">动态插入的 slide ' + counter + '</div></li>'; }; $('.js-demo-slider-btn').on('click', function() { var action = this.getAttribute('data-action'); if (action === 'add') { $slider.flexslider('addSlide', getSlide()); } else { var count = $slider.flexslider('count'); count > 1 && $slider.flexslider('removeSlide', $slider.flexslider('count') - 1); } }); }); </script> </body> </html>
<!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>图片轮播</title> <meta name="renderer" content="webkit"> <meta http-equiv="Cache-Control" content="no-siteapp"/> <link rel="icon" type="image/png" href="assets/i/favicon.png"> <meta name="mobile-web-app-capable" content="yes"> <link rel="icon" sizes="192x192" href="assets/i/[email protected]"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="Amaze UI"/> <link rel="apple-touch-icon-precomposed" href="assets/i/[email protected]"> <meta name="msapplication-TileImage" content="assets/i/[email protected]"> <meta name="msapplication-TileColor" content="#0e90d2"> <link rel="stylesheet" href="assets/css/amazeui.min.css"> </head> <body> <div class="am-slider am-slider-default am-slider-carousel" data-am-flexslider="{itemWidth: 200, itemMargin: 5, slideshow: false}"> <ul class="am-slides"> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> </ul> </div> <!--[if (gte IE 9)|!(IE)]><!--> <script src="assets/js/jquery.min.js"></script> <!--<![endif]--> <!--[if lte IE 8 ]> <script src="assets/ie8/jquery.min.js"></script> <script src="assets/ie8/modernizr.js"></script> <script src="assets/js/amazeui.ie8polyfill.min.js"></script> <![endif]--> <script src="assets/js/amazeui.min.js"></script> </body> </html>
<!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>图片轮播</title> <meta name="renderer" content="webkit"> <meta http-equiv="Cache-Control" content="no-siteapp"/> <link rel="icon" type="image/png" href="assets/i/favicon.png"> <meta name="mobile-web-app-capable" content="yes"> <link rel="icon" sizes="192x192" href="assets/i/[email protected]"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="Amaze UI"/> <link rel="apple-touch-icon-precomposed" href="assets/i/[email protected]"> <meta name="msapplication-TileImage" content="assets/i/[email protected]"> <meta name="msapplication-TileColor" content="#0e90d2"> <link rel="stylesheet" href="assets/css/amazeui.min.css"> </head> <body> <div class="am-slider am-slider-default" data-am-flexslider="{playAfterPaused: 8000}"> <ul class="am-slides"> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> <li><img src="http://s.amazeui.org/media/i/demos/pure-4.jpg" /></li> </ul> </div> <!--[if (gte IE 9)|!(IE)]><!--> <script src="assets/js/jquery.min.js"></script> <!--<![endif]--> <!--[if lte IE 8 ]> <script src="assets/ie8/jquery.min.js"></script> <script src="assets/ie8/modernizr.js"></script> <script src="assets/js/amazeui.ie8polyfill.min.js"></script> <![endif]--> <script src="assets/js/amazeui.min.js"></script> <script> $('#your-slider').flexslider({ playAfterPaused: 8000, before: function(slider) { if (slider._pausedTimer) { window.clearTimeout(slider._pausedTimer); slider._pausedTimer = null; } }, after: function(slider) { var pauseTime = slider.vars.playAfterPaused; if (pauseTime && !isNaN(pauseTime) && !slider.playing) { if (!slider.manualPause && !slider.manualPlay && !slider.stopped) { slider._pausedTimer = window.setTimeout(function() { slider.play(); }, pauseTime); } } } // 设置其他参数 }); </script> </body> </html>