Coder Social home page Coder Social logo

rex-slide's Introduction

rex-slide

轮播插件(带小图, 大图懒加载)

HTML结构

    <div class="rex-slide" id="slide">
        <div class="showBox">
            <ul>
                <li>
                    <img data-url="images/1.jpg" src="images/default.jpg" >
                    <img data-url="images/1.jpg" src="images/default.jpg" >
                </li>
            </ul>
        </div>
        <div class="listBox">
            <ul>
                <li class="on">
                    <img data-url="images/1.jpg" src="images/default.jpg" >
                    <img data-url="images/1.jpg" src="images/default.jpg" >
                </li>
            </ul>
        </div>
        <a class="btn btn-prev" href="javascript:;"></a>
        <a class="btn btn-next" href="javascript:;"></a>
    </div>

JS代码

    <script type="text/javascript" src="js/jquery-1.12.3.min.js"></script>
    <script type="text/javascript" src="js/rex-slide.js"></script>
    <script>

        var slide = $.rexSlide("#slide",{
            "bWidth" : 600, //大图宽度
            "sWidth" : 130, //小图宽度+右边距
            "show" : 4, //小图显示个数
            "lock" : 1, //小图锁定位置
            "autoplay" : 0 //自动轮播的时间间隔: 0代表不自动轮播, 默认4000;
        });
    </script>

API接口

    //上一张
    slide.prev();

    //下一张
    slide.next();

    //去到指定位置
    slide.goto(2);
    
    //开启轮播功能
    slide.startAuto();
    
    //关闭轮播功能
    slide.stopAuto();

rex-slide's People

Contributors

kyleloh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.