-
Notifications
You must be signed in to change notification settings - Fork 146
Events
Mottie edited this page Nov 17, 2012
·
5 revisions
Wiki Pages: Home | FAQ | Setup | Options | Usage | Events | Change | Credits
-
initialized.movingBoxes
(initialized
) Triggered when MovingBoxes has completed its initialization. It may occur before all animation has completed (hash tag updating). -
initChange.movingBoxes
(initChange
) Triggered immediately after the script is called to change the panels. No checks have been done at this point. An additional variable of the targeted panel number is available - see the examples below. -
beforeAnimation.movingBoxes
(beforeAnimation
) Triggered before the movingBoxes panels animate. An additional variable of the targeted panel number is available - see the examples below. -
completed.movingBoxes
(completed
) Triggered after the panels have completed their animations (sliding and resizing).
$('.slider').bind('initChange.movingBoxes beforeAnimation.movingBoxes completed.movingBoxes',function(e, slider, tar){
var txt = 'MovingBoxes with ID #' + slider.$el[0].id + ' has just triggered ' + e.type +
' is now on panel #' + slider.curPanel + ', and the targeted panel is ' + tar;
alert( txt );
});
$('.slider').movingBoxes({
initChange : function(e, slider, tar){
alert( 'MovingBoxes was called to change panels, the targeted panel is #' + tar );
},
beforeAnimation : function(e, slider, tar){
alert( 'You are about to switch from panel #' + slider.curPanel + ' to panel #' + tar);
},
completed : function(e, slider, tar){
alert( 'Now on panel #' + tar );
}
})
(assuming you used slider as the variable name inside the function function(e, slider, tar){}
)
-
slider.curPanel
Current active panel (enlarged and centered). Standard based index (e.g. first panel is number 1, second is number 2). This value is not updated with the targeted panel until thecompleted
event is called. -
slider.totalPanels
Number of panels inside that slider. -
slider.$el
jQuery object of the entire movingBoxes slider - this is the movingBoxes target when the script was initialized. -
slider.$panels
jQuery object of all of the panels. To target the current panel, useslider.$panels.eq( slider.curPanel - 1 )
. -
slider.options.{name}
Access any of the options this way. Do not try to set any of the options in this manner because it may break the movingBoxes slider.
Wiki Pages: Home | FAQ | Setup | Options | Usage | Events | Change | Credits