DataZombies / jQTouch

jQT extensions jqt.activityIndicator, jqt.bars (with numeric badges), jqt.checkGroup & jqt.segmentedControl.Get updates via Twitter http://twitter.com/HeadDZombie. If you find this fork useful please make a donation via PayPal (http://tinyurl.com/2fpmx27). See below for demo links.
MIT License
159 stars 34 forks source link

Tabbar Change #49

Closed camti closed 13 years ago

camti commented 13 years ago

Hi,

If I was to click on the Tabbar it changes to the current selected tab, however, If i was to link to this page from another link, for example in the main content, it doesn't change the tab.

For example, If I click on the Contact Us tab, if will show Contact Us as selected. However, If i included a separate link in on of my div's that said Contact Us, it would take you to the same div, but it wouldn't update the tabbar.

Hope you can understand this?

Thanks. Camti.

DataZombies commented 13 years ago

I understand your need. I'm rewriting the tabbar tap handler. I'll see if I can work this in.

camti commented 13 years ago

thank you so much.

camti commented 13 years ago

did not mean to close!

DataZombies commented 13 years ago

Don't worry, I won't forget this.

DataZombies Beaver, Pennsylvania, USA DataZombies@gmail.com

The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.

On Apr 18, 2011, at 7:52 PM, camti wrote:

did not mean to close!

Reply to this email directly or view it on GitHub: https://github.com/DataZombies/jQTouch/issues/49#comment_1024250

DataZombies commented 13 years ago

I can't think of an efficient way to do what you want. You can, though, change the state of the tab yourself. each tab is enumerated from left to right starting with tab_0. If you have five tabs and you want to turn off tab_3 and turn on tab_4 you'd do something like this: $('#tab_3').removeClass('enabled'); $'#tab_4').addClass('enabled'); you could attache that to your click event handler.

camti commented 13 years ago

Hi there,

thanks for your response, I have done this for my href's and this has worked brilliantly, thank you.

However, I have my app save the page that the user is on, is there any way to call that function in the document ready? I have tried but to no avail. The code is correct, but it doesn't change my tab.

Thanks, Camti.

DataZombies commented 13 years ago

Find the active tab's ID and save the it in the same place you save the page. On app launch check the tabbar's visibility and wait until it's not hidden. Then enable the right tab.