jSlider is a light weight JQuery plugin for content sliding. By content we mean everything: HTML code, Images, Advertisements etc etc. jSlider allows to put our content in simple <div>’s, and then it automatically generates a content slider for you, which one can customize using various options provided.
Screenshot
Below is a screen shot of a content slider using jSlider:

Download and Demo
jSlider is hosted at google code. Use the following links for demo and downloads:
Using jslider.jquery.js
Below is a sample html code which will be processed by jslider:
Sample input to jslider
<div id="jslider">
<div>
<input type="hidden" value="Title for Content 1"/>
<div>
HTML Content # 1
</div>
</div>
<div>
<input type="hidden" value="Title for Content 2"/>
<div>
HTML Content # 2
</div>
</div>
<div>
<input type="hidden" value="Title for Content 3"/>
<div>
HTML Content # 3
</div>
</div>
<div>
<input type="hidden" value="Title for Content 4"/>
<div>
HTML Content # 4
</div>
</div>
<div>
<input type="hidden" value="Title for Content 5"/>
<div>
HTML Content # 5
</div>
</div>
</div>
One must preserve the div structure as given in the example above. The hidden input values will be taken as heading for that block of content. If you want to have no heading or a common heading, fill this hidden input field appropriately.
Sample output from jslider
<div id="jslider">
<div class="slider">
<h2>Title for Content 1</h2>
<ul>
<li class="selected">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
<div class="content">
<div class="block">
<input type="hidden" value="Title for Content 1"/>
HTML Content # 1
</div>
<div class="block">
<input type="hidden" value="Title for Content 2"/>
HTML Content # 2
</div>
<div class="block">
<input type="hidden" value="Title for Content 3"/>
HTML Content # 3
</div>
<div class="block">
<input type="hidden" value="Title for Content 4"/>
HTML Content # 4
</div>
<div class="block">
<input type="hidden" value="Title for Content 5"/>
HTML Content # 5
</div>
</div>
</div>
Customizing jslider.jquery.js
jSlider provides following options for customization:
- width: Width of jslider div above, defaults to ‘610px’
- height: Height of jslider div above, defaults to ‘225px’
- slider_height: Height of slider div above (navigation bar), defaults to ‘24px’
- content_height: Height of content div above, defaults to ‘180px’
- block_width: Width of block div inside content div’s above, defaults to ‘590px’
- block_padding: Padding of block div inside content div’s above, defaults to ‘10px’
- animation_time: Time taken by 1 slide of content, defaults to 300 msec
- animation_type: Animation type, defaults to ‘linear’. Other option is ’swing’
Rest of the options like various padding etc can be controlled using the css properties. View demo for more implementation details. This is my first jquery plugin and I am only 2 weeks old in jquery. If you find any bug or need any enhancement, you are most welcome.
Abhi's Weblog is a collection of blog articles written by
[...] View post: Introducing jSlider: A Content Slider plugin for JQuery | Abhi's … [...]
[...] link is being shared on Twitter right now. @imoracle, an influential author, said Introducing jSlider: A [...]
[...] Introducing jSlider: A Content Slider plugin for JQuery [...]
Hi
Nice Plugin.But if I want next and previous button how to do that.Thanks
Yes thats the indented future enhancement. Allowing users to choose between various type of navigation schemes and also choose the place where they want to position it.
Checkout.
Hello
I’m having some problems trying to using the swing option
$(function() { $(‘#contentslider-1′).jslider({ height: ‘130px’, content_height: ‘130px’, slider_height: ‘24px’, content_height: ‘120px’, block_width: ‘555px’, block_padding: ‘10px’, animation_time: ‘200′,
animation_type: ’swing’ }); });
I’m doing it right?
Thanks for everything! Keep the good work :O)