Web Development with jQuery®

(Elliott) #1

(^446) ❘ CHAPTER 20 CREATING AN INTERACTIVE SLIDESHOW
slideshows[slideCollection] =
new slideshow(node, slideCollection);
node.data('slideshow', slideCollection);
}
}
);
}
});
// From John Resig's awesome class instantiation code.
// http://ejohn.org/blog/simple-class-instantiation/
var hot = {
factory : function()
{
return function(args)
{
if (this instanceof arguments.callee)
{
if (typeof(this.init) == 'function')
{
this.init.apply(this, args && args.callee? args : arguments);
}
}
else
{
return new arguments.callee(arguments);
}
}
}
};
var slideshow = hot.factory();
slideshow.prototype.init = function(node, slideCollection)
{
this.counter = 1;
this.isInterrupted = false;
this.transitioning = false;
this.resumeTimer = null;
if (!node.find('ul.slideshowControls').length)
{
node.prepend(
$('

    ').addClass('slideshowControls')
    );
    }
    node.find('ul.slideshowControls').html('');
    var slideInCollection = 1;
    node.find('.slide').each(
    http://www.it-ebooks.info

Free download pdf