Giter VIP home page Giter VIP logo

simple.carousel's Introduction

simple.carousel

Copyright (c) 2015 Tobias Zeising, http://www.aditu.de
Licensed under the MIT license
Version 0.3

This is a simple jQuery plugin for creating sliding carousels.

Demo/Examples

simple demo
aditu.de (image will change using a fade in/fade out effect)
rsslounge (presentation of the features by an slideshow)

Usage

Insert following in the head part of your html page:

<script type="text/javascript" src="javascript/jquery-1.8.3.min.js"></script> 
<script type="text/javascript" src="javascript/simple.carousel.0.3.js"></script> 
<script type="text/javascript"> 
jQuery(document).ready(function() {
	// initialize carousel
	$("#carousel").simplecarousel({
		next: $('.next'),
		prev: $('.prev'),
		slidespeed: 700,
		auto: 5000,
		width: 480,
		height: 280
	});
});
</script> 

This will change following html structure

	<ul id="carousel">
	 <li>first frame (e.g. an image)</li>
	 <li>second frame (e.g. an image)</li>
	 <li>third frame (e.g. an image)</li>
	 ...
	</ul>

into a slider

simple carousel slider

Parameters

parametertypeoutcome
widthintwidth of the single frames
heightintheight of the frames
nextjQuery Objekt/Selectorclicking on this object will show the next frame (for next button)
prevjQuery Objekt/Selectorclicking on this object will show the previous frame (for prev button)
verticalbooleanvertical sliding; false = horizontal sliding
autoint/booleanfalse = no automatic sliding; Value in milliseconds = time between two frames
slidespeedintspeed of the sliding effect in milliseconds
visibleintamount of frames which are visible
fadeintuse a fade out/fade in effect instead of the sliding effect. false = use sliding effect; time in milliseconds will activate the fadein/fadeout and set the speed of this effect
paginationintset true for this value and a pagination element will be included
pauseOnclickintA boolean that when true pauses the automatic sliding when user clicks in the current visible content. The default value is false.
paginationItemintA function which takes the item index as paramter and returns a string which will fill the button element. The default value is function( i ) { return ''; }

Example

$("#carousel").simplecarousel({
    next: $('.next'),
    prev: $('.prev'),
    auto: 4000,
    fade: 400
});

Will create a carousel with fadein/fadeout effect. The pause between two frames will be 4 seconds, the speed of the fade effect will be 400 ms, the element with the class 'next' will be the next button (the same with 'prev' for back button). See download for further examples.

simple.carousel's People

Contributors

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