Code Monkey home page Code Monkey logo

album-carousel's Introduction

album-carousel

一个基于 jQuery 的相册轮播插件。

效果展示

效果 Live Demo

使用说明

  1. 使用git clonedownload zip下载插件源码

  2. 在项目中引入 jQuery v1.9.1 及以上版本

  3. 添加html结构

    <div class="album">
        <div class="left-slide">
            <div class="hd">
                <ul></ul>
            </div>
            <div class="bd">
                <ul></ul>
            </div>
            <button class="prev hide">
                <</button>
                    <button class="next hide">></button>
        </div>
        <div class="right-slide">
            <div class="bd">
                <ul></ul>
            </div>
            <button class="prev hide"></button>
            <button class="next hide"></button>
        </div>
    </div>
  4. 引入插件相关css文件

    <!-- 地址根据需要修改 -->
    <link rel="stylesheet" href="./../albumCarousel.min.css">
  5. 引入插件js文件

    <!-- 地址根据需要修改 -->
    <script src="./../albumCarousel.min.js"></script>
  6. 初始化插件

    var albumData = [
        ["https://dummyimage.com/928x580/808F7C/fff", "https://dummyimage.com/928x580/66BAB7/fff"],
        ["https://dummyimage.com/928x580/211E55/fff", "https://dummyimage.com/928x580/f60/fff",
            "https://dummyimage.com/928x580/7B90D2/fff"
        ],
        ["https://dummyimage.com/928x580/ff5566/fff", "https://dummyimage.com/928x580/00896C/fff"],
        ["https://dummyimage.com/928x580/C1328E/fff"],
        ["https://dummyimage.com/928x580/A8D8B9/fff", "https://dummyimage.com/928x580/f60/fff"],
        ["https://dummyimage.com/928x580/f60/fff", "https://dummyimage.com/928x580/f60/fff",
            "https://dummyimage.com/928x580/f60/fff"
        ]
    ];
    
    $('.album').albumCarousel({
        albumData: albumData
    });

参数设置

var defaluts = {
    albumData: [], //相册数据,接收一个二维数组
    speed: 3000 //自动播放速度,默认3s切换
};

To Do

  • 图片切换速度
  • 自动/手动播放控制
  • 相册切换滑动效果
  • 优化CSS

album-carousel's People

Contributors

violay33 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.