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 work.  The code I am using now updates all of the
tabs to position 0 for all instances.

Current code
                $('.goabout').click(function() {
           $(".tabs").tabs('select', 0);
           return false;
       });
Can anyone help me with selected ".this" tab.  Thank you.

On Jan 17, 3:10 pm, MorningZ <morni...@gmail.com> wrote:
> if your link follows the pattern of having it's ID as "linkXX" where
> "XX" is the zero-based index of atab, then the live binding will
> "pick up" any newinstancesof 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 <market...@cmilc.com> wrote:
>
>
>
> > 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+)$/);
> >                 if (hit && lit.length == 2) {
> >                        $tabs.tabs('select', hit[1]);
> >                        return false;
> >                 }
> >         });
>
> > });
>
> > But, I must admit I know next to nothing aboutjquerylive events. Can
> > you help me understand what markup I would need to put on a <a href>
> > link to make this script work. I would love to be able to simplify my
> > method for allowing text links on the page to interact with thetabs.
> > Much Thanks!!
>
> > On Jan 16, 9:38 pm, MorningZ <morni...@gmail.com> wrote:
>
> > > There's no need to repeat the code...  you can even do it with ".live"
> > > so it'll work if there's 1 or 100tabs
>
> > > $(document).ready(function(){
> > >         var $tabs= $("#tabs").tabs();
> > >         $('a[id^='link').live("click", function() {
> > >                 var hit = this.id.match(/^link(\d+)$/);
> > >                 if (hit && lit.length == 2) {
> > >                        $tabs.tabs('select', hit[1]);
> > >                        return false;
> > >                 }
> > >         });
>
> > > });
>
> > > On Jan 16, 5:59 pm, CMI_Guy <market...@cmilc.com> wrote:
>
> > > > StephenJacob,
>
> > > > Sloppy fix. But works.
>
> > > > <script type="text/javascript">
> > > > $(document).ready(function(){
> > > >         var $tabs= $("#tabs").tabs();
> > > >         $('#link0').click(function() { // bind click event tolink
> > > >                 $tabs.tabs('select', 0); // switch to firsttab
> > > >                 return false;
> > > >         });});
>
> > > > $(document).ready(function(){
> > > >         var $tabs= $("#tabs").tabs();
> > > >         $('#link1').click(function() { // bind click event tolink
> > > >                 $tabs.tabs('select', 1); // switch to secondtab
> > > >                 return false;
> > > >         });});
>
> > > > $(document).ready(function(){
> > > >         var $tabs= $("#tabs").tabs();
> > > >         $('#link2').click(function() { // bind click event tolink
> > > >                 $tabs.tabs('select', 2); // switch to thirdtab
> > > >                 return false;
> > > >         });});
>
> > > > $(document).ready(function(){
> > > >         var $tabs= $("#tabs").tabs();
> > > >         $('#link3').click(function() { // bind click event tolink
> > > >                 $tabs.tabs('select', 3); // switch to fourthtab
> > > >                 return false;
> > > >         });});
>
> > > > $(document).ready(function(){
> > > >         var $tabs= $("#tabs").tabs();
> > > >         $('#link4').click(function() { // bind click event tolink
> > > >                 $tabs.tabs('select', 4); // switch to fifthtab
> > > >                 return false;
> > > >         });});
>
> > > > </script>
>
> > > > <div id="tabs">
> > > >         <ul>
> > > >             <li><a href="users-admin.php">Administrators</a></li>
> > > >             <li><a href="users-standard.php">Users</a></li>
> > > >             <li><a href="users-notify.php">Process Users</a></li>
> > > >             <li><a href="users-activity.php">User Activity</a></li>
> > > >             <li><a href="db-backup.php">Database Backup</a></li>
> > > >         </ul>
> > > > </div>
>
> > > > TEXT LINKS elsewhere on page that activate thetabs.
>
> > > > <a href="users-standard.php" id="link0">Administrators</a>
> > > > <a href="users-standard.php" id="link1">Users</a>
> > > > <a href="users-notify.php" id="link2">Process Users</a>
> > > > <a href="users-activity.php" id="link3">User Activity</a>
> > > > <a href="db-backup.php" id="link4>Database Backup</a>- Hide quoted text 
> > > > -
>
> > > - Show quoted text -

Reply via email to