Post Thumb Placeholder

SlideDeck Auto-Play on Mouse Enter

On July 12, 20100 Comments
<dl id="slidedeck" class="slidedeck">
	<dt>Slide 1</dt>
	<dd>Slide content</dd>
	<dt>Slide 2</dt>
	<dd>Slide content</dd>
	<dt>Slide 3</dt>
	<dd>Slide content</dd>
	<dt>Slide 4</dt>
	<dd>Slide content</dd>
	<dt>Slide 5</dt>
	<dd>Slide content</dd>
<script type="text/javascript">
	var MySlideDeck = $('#slidedeck').css({
		width: '900px',
		height: '300px'

	// initialize an autoplay switch
	var autoPlay = false;			

	function myLoop(){
		// only advance slides when the mouse is over.
			// Check to see if the current slide is the last slide
			if(MySlideDeck.current == MySlideDeck.slides.length){
				// This is the last slide, go to the first slide
			} else {
				// This is not the last slide, go to the next slide;

	setInterval(myLoop,2000);	// Run the myLoop() function every 2 seconds (2000 miliseconds)

	// set autoplay to on when the mouse enters
		autoPlay = true;
	// set autoplay to off when the mouse leaves
		autoPlay = false;
	// set autoplay to off when the mouse clicks
		autoPlay = false;


Comments are closed.