Permalink
Browse files

Fix the bug where 'walk' callback was not triggered with 'next' or 'p…

…revious' methods.
  • Loading branch information...
Jay Salvat
Jay Salvat committed Sep 28, 2011
1 parent ca82967 commit 5bbe16857affb56074aef82e8eb334b726f9d190
Showing with 9 additions and 4 deletions.
  1. +9 −4 jquery.vegas.js
View
@@ -1,7 +1,7 @@
// ----------------------------------------------------------------------------
// Vegas - jQuery plugin
// Add awesome fullscreen backgrounds to your webpages.
-// v 1.1 beta
+// v 1.x
// Dual licensed under the MIT and GPL licenses.
// http://vegas.jaysalvat.com/
// ----------------------------------------------------------------------------
@@ -35,12 +35,12 @@
backgrounds = [],
step = 0,
delay = 5000,
+ walk = function() {},
timer,
methods = {
// Init plugin
init : function( settings ) {
-
var options = {
src: getBackground(),
align: 'center',
@@ -170,7 +170,7 @@
delay: delay,
preload: false,
backgrounds: backgrounds,
- walk: function() {}
+ walk: walk
};
$.extend( options, $.vegas.defaults.slideshow, settings );
@@ -180,6 +180,10 @@
options.step = 0;
}
+ if ( !settings.walk ) {
+ options.walk = function() {};
+ }
+
if ( options.preload ) {
$.vegas( 'preload', options.backgrounds );
}
@@ -188,6 +192,7 @@
backgrounds = options.backgrounds;
delay = options.delay;
step = options.step;
+ walk = options.walk;
clearInterval( timer );
@@ -210,7 +215,7 @@
if ( settings.fade > options.delay ) {
settings.fade = options.delay;
}
-
+
$.vegas( settings );
}
doSlideshow();

0 comments on commit 5bbe168

Please sign in to comment.