jQuery UI tab - onselect goto link


/ Published in: JavaScript
Save to your folder(s)

Go to link location when tab clicked (or selected actually) using 'select' event.


Copy this code and paste it in your HTML
  1. <script language=Javascript>
  2. $(document).ready(function(){
  3. $("#theTab").tabs({
  4. select: function() {
  5. window.location.href = $(this).attr('href'); //go to link from a tag.
  6. }
  7. });
  8. });
  9. </script>
  10.  
  11. Tab format:
  12. <ul id="theTab">
  13. <li><a href="{link}"><span>{label}</span></a></li>
  14. </ul>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.