Web Development with jQuery®

(Elliott) #1

Creating a Slideshow (^) ❘ 449
node.find('ul.slideshowControls li')
.removeClass('slideshowControlActive');
$('#slide-' + slideCollection + '-' + this.counter).fadeIn(
'slow',
function()
{
node.find('ul.slideshowControls li').each(
function()
{
if (parseInt($(this).text()) ==
slideshows[slideCollection].counter)
{
$(this).addClass('slideshowControlActive');
}
}
);
slideshows[slideCollection].counter++;
var resetCounter = (
slideshows[slideCollection].counter >
node.find('ul.slideshowControls li').length
);
if (resetCounter)
{
slideshows[slideCollection].counter = 1;
}
setTimeout(
'slideshows[' + slideCollection + '].transition();',
5000
);
}
);
};
this.transition();
};
$(document).ready(
function()
{
if ($('.slideshow').length)
{
$('.slideshow').slideshow();
}
}
);
The preceding example results are shown in Figure 20-1.
http://www.it-ebooks.info

Free download pdf