noelcaribbean
New Member
I have a question regarding a tabs script (not jquery ui tabs). I want to select the tab with a normal text link on top of the page. The tabs are at the bottom of the page. I was hoping this could be achieved with an anchor, but no....The link: \[code\]<a class="reviewslink" href="http://stackoverflow.com/questions/14553845/#reviews">blabla</a>\[/code\]The script for clicking on the tabs itself:\[code\]$('.tabs a').click(function(){ var tabs = $(this).closest('.tabs'); var pages = tabs.next(); tabs.find('a').closest('li').removeClass('active'); pages.find('.page').removeClass('active'); $(this).closest('li').addClass('active'); pages.find('.page.'+$(this).attr('rel')).addClass('active'); return false; });\[/code\]I tried this below but that doesn't work, obvious. I can't figure out how I should do this. \[code\] $('.reviewslink').click(function() { // bind click event to link var tabs = $(this).closest('.tabs'); var pages = tabs.next(); tabs.find('a').closest('li').removeClass('active'); pages.find('.page').removeClass('active'); tabs.select('select', 3).addClass('active'); pages.find('.page.reviews.'+$(this).attr('rel')).addClass('active'); return false; });\[/code\]Any help greatly appreciated.