jaysalvat/vegas — pull request #23 by wiseguydigital (2012-12-05 14:19:41+00:00)
Title: Added a jQuery plugin wrapper

This could be cleaner, but here is some code that now wraps the $.vegas plugin into a jQuery plugin.

It can now be used either in the current way (targeting the body element) or by specifying a target element e.g.:

// Single image
$("#myele").vegas({
src:'img/background-1.jpg'
})

// Overlay
$("#myele").vegas('overlay', {
src:'img/overlays/13.png'
});

// Slideshow
$('#myele').vegas('slideshow', {
backgrounds:[
{ src:'img/background-1.jpg', fade:1000 },
{ src:'img/background-2.jpg', fade:1000 },
{ src:'img/background-3.jpg', fade:1000 }
]
}).vegas('overlay', {
src:'img/overlays/11.png'
});

// Extra methods
$('#myele').vegas('pause');

Not had much time to test, but all seems to be working!