I'm a big fan of this idea, Klaus, and even made a first attempt at integrating my own "pre-callback". It's useful to me because I am dynamically loading (via AHAH) the content of each tab and I want the content to load before the tab actually makes the switch. As it is, the tab switches to an empty div (rather unattractive), then the content loads and pushes the div into shape.
m. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Hartl Sent: Wednesday, November 22, 2006 3:26 AM To: jQuery Discussion. Subject: [jQuery] Tabs plugin callbacks - what makes most sense? Hi all, I'm thinking about extending the callback system in the Tabs plugin to not only allow one callback, but different ones for more flexibility: onActivate (invoked on click), onHide (invoked after old tab got hidden), onShow (invoked after new tab is revealed == callback as is now). First question: Does that make sense at all? If yes, the way it is now is that the callback function is called with the scope of the tab container (the div) that gets revealed and two arguments which the first could also be referred to with "this" obviously: settings.callback.apply(toShow[0], [toShow[0], toHide[0]]); Seems redundant to me. The only advantage I see here is that I could define a function without arguments if I only need to refer (via "this") to the tab that gets shown. Wouldn't it be more reasonable to have "this" being the tab that was clicked? settings.callback.apply(clicked, [toShow[0], toHide[0]]); Feedback appreciated! -- Klaus _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/ _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
