Giter Club home page Giter Club logo

zslider's Introduction

zSlider

A pure JavaScript Carousel/Slider plugin that works well at Mobile/PC.

Getting Started

This plugin wrote in pure JavaScript and has no dependencies like jQuery.

Install the plugin via bower

bower install zSlider --save

Once the plugin has been installed, you can use it easily:

Usage

Overview

You can just generate a slider with one line:

var slider = new Slider('#slider1', '.z-slide-item');
<div class="z-slide-wrap top" id='slider1'>
    <ul class="z-slide-content">
        <li class="z-slide-item"></li>
        <li class="z-slide-item"></li>
        <li class="z-slide-item"></li>
    </ul>
</div>

Options

When init with new Slider(container, slideItems, option);, a optional config can be used. What can be config?

var option = {
    'current': 0, // which to show when init
    'duration': 0.8, // animation duration, seconds
    'minPercentToSlide': null, // percent to decide to slide
    'autoplay': true, // autoplay?
    'direction': 'left', // autoplay direction
    'interval': 5 // seconds
};

Usage Examples

There is a built-in demo:

git clone [email protected]:creeperyang/zSlider.git
cd zSlider
npm install
grunt serve

Release History

2015-04-30    v0.0.1    init

License

Copyright (c) 2015 creeperyang. Licensed under the MIT license.

zslider's People

Contributors

creeperyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zslider's Issues

Dots with link?

Hi very cool slider good job! is possible activate the links on the dots?

2 item Issue

Hi
The next and previous icon getting overlap when I have only 2 item in the slider.....
can you give the solution for this....

Ya

My question is When I have only 2 item in the slider in that case the zSlider will clone the two item and clone at the bottom of the slider. which is making issue.

can't we avoid the cloning the items when we have only 2 items..

lower-end devices transition doesn't work

transition: transform 0.8s linear is appended to a DOM element for active carousel images (pre, curr) but I've noticed this particular css doesn't get appended to the style attribute on lower-end Android devices (so far I discovered on 4.4.2, 4.4.4). Higher-end such as Android 6.0 seems fine.

setTransition method works fine, but somewhere in setCompatibleStyle at

return function(el, prop, value) {
    el.style[getGoodPropName(prop)] = value;
};

fails. Can you please take a look at this?

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.