Understood.  I figured out my issue, which turned out i didn't need to
use the load event at all.

I needed to load a specific tab on page load, based on what the user
selected after a page refresh.  I did this by setting a hidden
variable in my page to the currently selected tab, and had a little
jquery magic to select the tab with the index stored in the hidden
variable.  Hope this helps someone:

$(function() {
                var lastselected = $("input[type=hidden]
[id*=hdnSelectedTab]").val();
                if (lastselected > 0) {
                    myselected = lastselected;
                } else {
                    myselected = 0;
                }

                var tabOpts = {
                    selected: myselected,
                    select: function(event, ui) {
                        var selected = ui.index;
                        $("input[type=hidden][id*=hdnSelectedTab]").val
(selected);
                    }
                };

                $("#tabs").tabs(tabOpts);
            });

On Nov 22, 8:30 pm, Steven Black <[email protected]> wrote:
> According to the docs, the load event "is triggered after the content
> of a remote tab has been loaded."
>
> Remote tabs are those that fetch their content via AJAX.
>
> Note that there is also a load *method* and this also involves AJAX.
>
> Maybe you are thinking of the show() event?  From the docs, "This
> event is triggered when a tab is shown."
>
> **--**  Steve
>
> On Nov 22, 6:10 pm, charnibp <[email protected]> wrote:
>
> > btw, i'm using Firefox 3.5.5 on win XP
>
> > On Nov 22, 6:09 pm, charnibp <[email protected]> wrote:
>
> > > Hi, I'm using jquery-ui 1.7.2.  All i'm trying to do is use the load
> > > event of the tabs and it doesn't seem to be firing.  A simple test
> > > does not alert anything:
>
> > > $(document).ready(function() {
> > >             $('#tabs').tabs({
> > >                 load: function(event, ui) {
> > >                     alert('loaded');  //should alert here, never
> > > happens
> > >                 }
>
> > >             });
>
> > > Any ideas what the problem might be?  Am I doing something wrong?

--

You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=.


Reply via email to