Giter Club home page Giter Club logo

wslider's Introduction

Wslider

A simple jQuery plugin to easily create bootstrap carousels

Getting Started

You need to just download the zip file and extract it, then include wslider.js or wslider.min.js file into your html file and you are ready to go.

Prerequisites

To use this plugin you must include bootstrap (bootstrap.css and bootstrap.js) and jQuery (jquery.js) files into your project.

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8"> 
  <title>wslider demo</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>	
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

Installing

Follow the following steps to use this plugin

1. Include plugin into your html file

    <script src="wslider.js"></script>	

2. Create a
in which you want to wrap your slider

    <div id="wslider"></div>	

3. Create a JSON array containing urls of images for your slider and pass it to wslider in order to intialize wslider plugin.


Below is the example of how to use plugin with minimum options
    <script type="text/javascript">
		$(document).ready(function(){
			var slides=
			[	
				{
					image:'slide1.jpg'
				},
				{
					image:'slide2.jpg'
				}
			];
			$('#slider').wslider({slides:slides});			
						
		});		 
	</script>	


Here is an example with all option
	<script type="text/javascript">
		$(document).ready(function(){
			var slides=
			[	
				{
					image:'slide1.jpg',
					alt:'wslide 1',
					title:'Slide 01',
					description:'This is slide no 01'
				},
				{
					image:'slide2.jpg',
					alt:'wslide 2',
					title:'Slide 02',
					description:'This is slide no 02'
				},
				
			];
			$('#slider').wslider(
			{
				slides:slides,
				next_text:'Next Slide',
				previous_text:'Prev Slide',
				interval:3000,
				pause_on_hover:true,
				cycle:true
			});			
						
		});		 
	</script>

Details of options

slides(array) - array containing urls of images to show in slider
image(string) - url of image to display in slider
alt(string) - alternate text for image [optional]
title(string) - heading or title of slide [optional]
description(string) - sub heading or details about slide [optional]

next_text(string) - text to display for next slide control [optional]
previous_text(string) - text to display for previous slide control [optional]
interval(number) - number of milliseconds after which slide change [optional]
pause_on_hover(boolean) - whether the slider should pause on mouse hover or not [optional]
cycle(boolean) - whether the slider should go through all slides continuously, or stop at the last slide [optional]

Default values are as follows

	defaultSetting={
			slides:[],
			next_text:'Next',
			previous_text:'Previous',
			interval:5000,
			pause_on_hover:'hover',
			cycle:true
		}

View Demo

Built With

  • Bootstap - Use to build responsive web app
  • jQuery - Javascript library

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

wslider's People

Contributors

mwasim164 avatar

Watchers

 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.