Using jQuery Auto Image Scroller

Submitted by:Jhon Jhon

Date added:24 May, 2012

Category:jQuery

An example code using jQuery Auto Image Scroller

Tags: image scroller

Code Snippet:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<title>jQuery Auto Image Scroller</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery-1.2.3.pack.js ">
</script>
<script type="text/javascript" src="jquery.jcarousel.pack.js ">
</script>
<link rel="stylesheet" type="text/css" href="jquery.jcarousel.css " />
<link rel="stylesheet" type="text/css" href="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.startAuto(0);
});
carousel.buttonPrev.bind('click', function () {
carousel.startAuto(0);
});
// Pause autoscrolling if the user moves with the cursor over the clip.
carousel.clip.hover(function () {
carousel.stopAuto();
}, function () {
carousel.startAuto();
});
};
jQuery(document).ready(function () {
jQuery('#mycarousel').jcarousel({
auto: 2,
wrap: 'last',
initCallback: mycarousel_initCallback
});
});
</script>
</head>
<body>
<div id="wrap">
<ul id="mycarousel" class="jcarousel-skin-tango">
<li>
<img src="Images/window8-1.jpg" width="75" height="100" alt="i1" />
</li>
<li>
<img src="Images/window8-2.jpg" width="75" height="100" alt="i2" />
</li>
<li>
<img src="Images/window8-3.jpg" width="75" height="100" alt="i3" />
</li>
<li>
<img src="Images/window8-4.jpg" width="75" height="100" alt="i4" />
</li>
</ul>
</div>
</body>
</html>
 
 

Comments