[jQuery] Re: Select tab from link

2010-01-23 Thread inidaho
Newbie. I have multiple tabs instances on a single page. They each have a different ID and each set of tabs has 5 tabs. If I am trying to go to a specific tab via link within a specific set of tabs but it is updating them all. I figure I need a ".this" command somewhere but haven't been able to

[jQuery] Re: Select tab from link

2010-01-17 Thread MorningZ
if your link follows the pattern of having it's ID as "linkXX" where "XX" is the zero-based index of a tab, then the live binding will "pick up" any new instances of such links in your AJAX responses/ additions btw, i had a typo... "lit.length" should be "hit.length" On Jan 17, 11:06 am, CMI_Guy

[jQuery] Re: Select tab from link

2010-01-17 Thread CMI_Guy
MorningZ, Thanks for your reply. Something was missing from your syntax so I made one small change to your script: $(document).ready(function(){ var $tabs = $("#tabs").tabs(); $("a[id^='link']").live("click", function() { var hit = this.id.match(/^link(\d+)$/);

[jQuery] Re: Select tab from link

2010-01-17 Thread CMI_Guy
Thanks MorningZ.. But, it "appears" that your script is missing syntax somewhereI do not know enough about javascript to find the error. Any ideas why it's not showing as valid? $(document).ready(function(){ var $tabs = $("#tabs").tabs(); $('a[id^='link').live("click", function

[jQuery] Re: Select tab from link

2010-01-16 Thread MorningZ
There's no need to repeat the code... you can even do it with ".live" so it'll work if there's 1 or 100 tabs $(document).ready(function(){ var $tabs = $("#tabs").tabs(); $('a[id^='link').live("click", function() { var hit = this.id.match(/^link(\d+)$/);

[jQuery] Re: Select tab from link

2010-01-16 Thread CMI_Guy
StephenJacob, Sloppy fix. But works. $(document).ready(function(){ var $tabs = $("#tabs").tabs(); $('#link0').click(function() { // bind click event to link $tabs.tabs('select', 0); // switch to first tab return false; }); }); $(document).r