- Edited
Hey guys,
I'm trying to build a tabbed navigation menu using jQuery and CSS. I have to admit that I was never good with jQuery and I refer to the API very often. But sometimes I cannot figure it out on my own, especially because I do not know how to debug Javascript code! So anyway, to make a long story short here's my jQuery functions:
P.S: If you know of a good tool/plugin that helps me debug javascript/jquery code please let me know about it. Thank you.
I'm trying to build a tabbed navigation menu using jQuery and CSS. I have to admit that I was never good with jQuery and I refer to the API very often. But sometimes I cannot figure it out on my own, especially because I do not know how to debug Javascript code! So anyway, to make a long story short here's my jQuery functions:
$(function() {
scrollAds();
tabNavigation();
});
function tabNavigation() {
$("#mainNav li").click(function() {
var menuItems = $("#mainNav li").toArray();
for(var i = 0; i < menuItems.length(); i++) {
if(menuItems[i].hasClass("selected"))
menuItems[i].removeClass("selected");
}
$(this).addClass("selected");
});
}
Any suggestions?P.S: If you know of a good tool/plugin that helps me debug javascript/jquery code please let me know about it. Thank you.