I've done something similar in order to reload the correct tab if the
user refreshes or bookmarks:
---------------
$nav = $(".mainNav ul").tabs({
        // set url hash to selected tab
        select: function(event, ui){
                document.location.hash = $(ui.panel).attr("id");
                window.scroll(0,0);
        }
});
// go to tab set in url
$nav.tabs('select', document.location.hash);
-------------

The problem with setting the hash is that it makes the page scroll
down, thus making the page jump.  So I put in a window.scroll(0,0) to
reset the scroll after setting the hash.  Yet, IE is not quick enough
and you see a flash.

Anyone have ideas on how to set the hash so that the correct tab shows
on reload here?  (actually, I just had an idea of adding a prefix to
the hash name so the browser doesn't find the correct element on the
page, so won't scroll.... I'll try and comment again...)


On Jun 4, 2:10 pm, Apfel007 <ravesl...@gmx.net> wrote:
> Hi, my first posting in this group. Hope someone can give me a hint.
>
> Is it right, that there is no hash sended to the url in jquery "TABS
> 3" by default ? means the hash is not visible in the url? I'm new on
> this stuff ...
>
> I've read that I can send the hash with this to url.. select: function
> (event,.....
>
> .tabs({ selectedClass: 'active', select: function(event, ui)
> { window.location = ui.tab.href; }, cookie: { expires: 0}, fx: fx })
>
> this will send the hash to url, but add it like this mysite#hash AND
> the worst thing is, that the tab content is not changing anymore..
> Could someone help my to fix this...
> Add the hash as an url-segment like this mysite/#hash
>
> Thanks

Reply via email to