GithubHelp home page GithubHelp logo

jordan-carl / glide.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from glidejs/glide

0.0 2.0 0.0 104 KB

Glide is responsive and touch-friendly jQuery slider. Based on CSS3 transitions with fallback to older broswers. It's simple, lightweight and fast. Designed to slide, no less, no more.

Home Page: http://jedrzejchalubek.com/glide/

glide.js's Introduction

#Glide.js

Glide is responsive and touch-friendly jQuery slider. Based on CSS3 transitions with fallback to older broswers. It's simple, lightweight and fast. Designed to slide, no less, no more.

##Setup

###1. Include jQuery jQuery is the only dependency. Make sure to include it.

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

###2. Include Glide.js <script src="jquery.glide.js"></script>

###3. Make necessary markup Link to slider stylesheet inside document head.

<link rel="stylesheet" type="text/css" href="css/style.css">

Make necessary markup for slider.

<div class="slider">
	<ul class="slides">
		<li class="slide"></li>
		<li class="slide"></li>
		<li class="slide"></li>
	</ul>
</div>

###4. Init Init our slider on default options ...

<script>
	$('.slider').glide();
</script>

โ€ฆ or with custom options

<script>
	$('.slider').glide({
		autoplay: 5000,
		arrows: 'body',
		nav: 'body'
	});
</script>

##Options Here is all list of averaible

Option Default Type Description
autoplay 4000 int/bool False for turning off autoplay
animationTime 500 int !!! That option will be use only, when css3 are not suported. If css3 are supported animation time is set in css transitions declaration inside .css file !!!
arrows true bool/string Show/hide/appendTo arrows. True for append arrows to slider wrapper. False for not appending arrows. Id or class name (e.g. '.class-name') for appending to specific HTML markup
arrowsWrapperClass slider-arrows string Arrows wrapper class
arrowMainClass slider-arrow string Main class for both arrows
arrowRightClass slider-arrow--right string Right arrow class
arrowLeftClass slider-arrow--left string Left arrow class
arrowRightText next string Right arrow text
arrowLeftText prev string Left arrow text
nav true bool/string Show/hide/appendTo bullets navigation. True for append arrows to slider wrapper. False for not appending arrows. Id or class name (e.g. '.class-name') for appending to specific HTML markup.
navCenter true bool Center bullet navigation
navClass slider-nav string Navigation wrapper class
navItemClass slider-nav__item string Navigation item class
navCurrentItemClass slider-nav__item--current string Current navigation item class
touchDistance 60 int/bool Minimal touch-swipe distance to call event. False for turning off touch.

##API

Make glide api instance.

var glide = $('.slider').glide().data('api_glide');

Now, you can use API as bellow.

glide.jump(3, console.log('Wooo!'));
  • .play() - Starting autoplay
  • .pause() - Stopping autoplay
  • .next(callback) - Slide one forward
  • .prev(callback) - Slide one backward
  • .jump(distance, callback) - Jump to current slide
  • .current() - Returning current slide number
  • .nav(target) - Append navigation to specifed target (eq. 'body', '.class', '#id')
  • .arrows(target) - Append arrows to specifed target (eq. 'body', '.class', '#id')

##Changelog 1.0.2 / 22.08.2013

  • Translate3d slides change (thanks to OwlFonk for suggestion)
  • Extend API, getter for current slide number

1.0.1 / 22.08.2013

  • Modularize code
  • Some options changes
  • Extend API, manually appending navigation and arrows with specifed target

1.0.0 / 19.08.2013

  • Plugin release

glide.js's People

Contributors

jedrzejchalubek avatar

Watchers

James Cloos avatar carl 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.