Coder Social home page Coder Social logo

slider's Introduction

A jQuery slide plugin.

Getting started

Installation

Include files:

<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/slider.js"></script>

Usage

Initialize with $.fn.slider method

$("#target").slider({
    activeClass: "slider-active", // for slide nav
    autoplay: true,
    contentClass: "slider-content",
    disableClass: "slider-disabled", // for slide "prev" and "next" button
    duration: 5000,
    effect: "fade",
    easing: "swing", // support "swing" and "linear", powered by jquery
    navClass: "slider-nav",
    nextClass: "slider-next",
    prevClass: "slider-prev",
    speed: 1000,
    trigger: "click" // for slide nav
});

Options

Setup with $("#target").slider(options), or global setup with $.fn.slider.setDefaults(options).

activeClass

  • type: string
  • default: "slider-active"

A active state class for nav items.

autoplay

  • type: boolean
  • default: true

Auto play the slide after initialized.

contentClass

  • type: string
  • default: "slider-content"

The content container.

disableClass

  • type: string
  • default: "slider-disabled"

A disable state class for prev and next button.

duration

  • type: number
  • default: 5000

The duration milliseconds of each slide item.

effect

  • type: string
  • options: "fade", "scrollx", "scrolly"
  • default: "fade"

easing

  • type: string
  • options: "swing", "linear"
  • default: "swing"

Powered by jquery.

navClass

  • type: string
  • default: "slider-nav"

The navigation container.

prevClass

  • type: string
  • default: "slider-prev"

The prev button.

nextClass

  • type: string
  • default: "slider-next"

The next button.

speed

  • type: number
  • default: 1000

The speed of the animation.

trigger

  • type: string
  • default: "click"

The event of trigger sliding.

Methods

  • render - Render the slider
  • start - Start the slider
  • stop - Stop the slider
  • enable - Enable the slider
  • disable - Disable the slider

Usage example:

$("#target").slider({
    autoplay: false
}).slider("start");

Browser Support

  • IE 6+
  • Chrome 33+
  • Firefox 27+
  • Safari 5.1+
  • Opera 19+

As a jQuery plugin, you can reference to the jQuery Browser Support.

Released under the MIT license.

slider's People

Watchers

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