I figure it out. It is a stupid error.
It seems that tabs('select', index) only accept integer as the type of
parameter index. SO i made following change and it works.
$(".wirelessPlansTabs > .tabs").tabs('select', parseInt(tabIndex));
And this makes me really confused. Because in RSH's listener, I use
following code :
function historyChange(newLocation, historyData)
{
$(".wirelessPlansTabs .tabs").tabs();
$(".wirelessPlansTabs .tabs").tabs("select", newLocation*1);
}
it works fine. but it does not work with parseInt().
Thanks
On Mar 25, 10:36 am, Gavin <[email protected]> wrote:
> I implemented the Jquery UI Tabs & RSH. They work perfectly when users
> do in page navigation. The history is remembered and URL also changed
> accordingly..
>
> For example, for the third tab, the URL is
> like:http://www.XXX.com/shopping/rateplan.page?#2
>
> The problem, when user navigate away, click browser "back" button to
> come back, the URL is correct. but it always show me the previous tab,
> not the tab on which user is browsing before they leave,
>
> I use following code to select tab:
>
> <script type="text/javascript">
> // <![CDATA[
> $(document).ready(function() {
> var start =
> window.location.href.lastIndexOf("#");
> var tabIndex = 0;
> if ( start !== -1 )
> tabIndex =
> window.location.href.substring(start+1, start + 2 ) ;
> $(".wirelessPlansTabs .tabs").tabs();
> $(".wirelessPlansTabs > .tabs").tabs
> ('select', tabIndex);
> })
> // ]]>
> </script>
>
> For the URLhttp://www.XXX.com/shopping/rateplan.page?#2, And I used
> alert to print out the value of tabIndex, it is 2. I do not why it
> always show me the second tab, not the third.
>
> Any idea?
>
> Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---