JQuery Menu Tabs - Highlight Selected


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



Copy this code and paste it in your HTML
  1. function showContent(id)
  2. {
  3. var items = ['estore','marketplace','favourites'];
  4. // Highlight Selected Buttons
  5. $.each( items, function(key, value){
  6. if(value != id)
  7. {
  8. $('#'+value).removeClass('selected');
  9. $('#my_'+value).css('display','none');
  10. }else{
  11.  
  12. $('#'+id).addClass('selected');
  13. $('#my_'+id).css('display','block');
  14. }
  15. });
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.