Share on Google+Share on Google+

jQuery Example, jQuery to Retrieve Server's Current Time, jQuery Server time

jQuery Example, jQuery to Retrieve Server's Current Time, jQuery Server time

jQuery to Auto Image Scroller


In this first jQuery tutorial we will develop a  program that auto image scroller.

There are many used of Auto Image Scroller on the website. You can use this jQuery based image scroller to display a set of images in it.

The jQuery framework will then take care of automatically scrolling the images. It give very good looking presentation to the user. Your website user will find this a very good as compared to simple css and JavaScript based image scroller.

It also loads fast and gives good performance.

Steps to develop the program

 Step 1:

Create a new file (simple_carousel.html) and add the following code into

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en-us">
<title>jCarousel Examples</title>
<link href="../style.css" rel="stylesheet" 
type="text/css" />

<script type="text/javascript" 

<script type="text/javascript" 

<link rel="stylesheet" type="text/css" 

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

<script type="text/javascript">
function mycarousel_initCallback(carousel)
// Disable autoscrolling if the user 
//clicks the prev or next button.
carousel.buttonNext.bind('click', function() {

carousel.buttonPrev.bind('click', function() {

// Pause autoscrolling if the user moves 
//with the cursor over the clip.
carousel.clip.hover(function() {
}, function() {

jQuery(document).ready(function() {
auto: 2,
wrap: 'last',
initCallback: mycarousel_initCallback
<div id="wrap">
<ul id="mycarousel" class="jcarousel-skin-tango">
<img src="images/w1.jpg" width="75" height="75" alt="i1" />
<img src="images/w2.jpg" width="75" height="75" alt="i2" />
<img src="images/w3.jpg" width="75" height="75" alt="i3" />
<img src="images/w4.jpg" width="75" height="75" alt="i4" />

Program explanation:

The following code includes the jQuery JavaScript library file:

<script type="text/javascript" src="script/jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="script/jquery.jcarousel.pack.js"></script>


Function is called 


having attributes

  auto: 2,
  wrap: 'last',
  initCallback: mycarousel_initCallback

 The image scroll in 2 sec and onclick and hover scroll the images is pause.


When you run the program in browser it will look like following screen shot:



Check online demo of the application

Learn from experts! Attend jQuery Training classes.


Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: jQuery Example, jQuery to Retrieve Server's Current Time, jQuery Server time  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image