Solved

How to get the selected spry tab with Jquery?

Posted on 2013-01-15
4
469 Views
Last Modified: 2013-01-15
Hello guys

When I click on the tab I need to get the selected spry tab with jquery, so that I can go on with my code. I can't figure out how to get the selected tab index.

<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" id="tab1">Tab 1</li>
    <li class="TabbedPanelsTab" id="tab2">Tab 2</li>
    <li class="TabbedPanelsTab" id="tab3">Tab 3</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">Content 1</div>
    <div class="TabbedPanelsContent">Content 2</div>
    <div class="TabbedPanelsContent">Content 2</div>
  </div>
  <input type="submit" value="complete" class="complete">  
</div>

Open in new window


thanks
0
Comment
Question by:hidrau
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38778132
$('.TabbedPanelsTab').on('click', function(){
  alert($(this).attr('id'));
});

Take a look at this fiddle I created: http://jsfiddle.net/slim81/6ZTJK/
0
 
LVL 1

Author Comment

by:hidrau
ID: 38778168
yeah, it was what I really wanted.

thanks very much
0
 
LVL 1

Author Closing Comment

by:hidrau
ID: 38778171
thanks
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38778202
do have jQuery running perfectly? no plugin conflict?

EDIT : ok, ok I'm late lol
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now