zoukankan      html  css  js  c++  java
  • photoSlider-原生js移动开发轮播图、相册滑动插件

    详细内容请点击

    移动相册轮播图

    在线预览   立即下载

    使用方法:

    分别引用css文件和js文件 如:


    <link rel="stylesheet" type="text/css" href="css/photoSlider.min.css" />
    <script src="js/photoSlider.min.js" type="text/javascript" charset="utf-8"></script>

    html:


    <li><a href="http://www.j--d.com"><img src="img/1.jpg" /></a></li>
    <li><a href="http://www.j--d.com"><img src="img/2.jpg" /></a></li>
    <li><a href="http://www.j--d.com"><img src="img/3.jpg" /></a></li>

    javascript:


    window.onload=function(){
    photoSlide({
    wrap: document.getElementById('photo'),//最外层容器
    loop: true,//设置无缝循环
    autoPlay:true,//自动轮播
    autoTime:4000,//轮播时间间隔
    pagination:true //点状态列表
    });
    }

    完整示例:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>photoSlider-纯js移动开发轮播图、相册滑动插件</title>
    <meta name="keywords" content="javascript移动端相册轮播图手指滑动插件" />
    <meta name="description" content="javascript移动端相册轮播图手指滑动插件,支持自定义轮播图滑动属性" />
    <meta name=apple-mobile-web-app-title content="photoSlider">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name=renderer content=webkit>
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="x5-fullscreen" content="true">
    <meta name="x5-page-mode" content="app">
    <link rel="stylesheet" type="text/css" href="css/photoSlider.min.css" />
    </head>
    <body>
    <div id="photo">
    <div id="loading" class="spinner">
    <div class="bounce1"></div>
    <div class="bounce2"></div>
    <div class="bounce3"></div>
    </div>
    <ul id="pic-view" class="pic-view">
    <li><a href="http://www.j--d.com"><img src="img/1.jpg" /></a></li>
    <li><a href="http://www.j--d.com"><img src="img/2.jpg" /></a></li>
    <li><a href="http://www.j--d.com"><img src="img/3.jpg" /></a></li>
    </ul>
    </div>
    </body>

    </html>

    <script src="js/photoSlider.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    document.onreadystatechange = subSomething;
    function subSomething() {
    if (document.readyState == 'complete') {
    setTimeout(function(){
    var load=document.getElementById('loading');
    load.style.opacity=0;
    document.getElementById('pic-view').setAttribute('class','pic-view show');
    load.remove();
    },500);
    }
    }
    window.onload=function(){
    photoSlide({
    wrap: document.getElementById('photo'),
    loop: true,
    autoPlay:true,
    autoTime:4000,
    pagination:true
    });
    }
    </script>

    手机预览效果请扫描二维码:
    photoSlider

    在线预览   立即下载

    学习来源:http://www.j--d.com/html/349.html

    更多特效内容请点击

  • 相关阅读:
    正式班D25
    解决oracle用户锁定
    python学习第17天
    python学习第16天
    python学习第15天
    python学习第十四天
    python学习第13天
    Python基础
    python学习第12天
    python学习第11天
  • 原文地址:https://www.cnblogs.com/j--d/p/photoSlider-html5.html
Copyright © 2011-2022 走看看