Hello,
I'm trying to make a menu navigation but now that it's working it just don't change the page. When i click the page don't change but the clicked menu stays selected. What am i doing wrong?
// CSS
//JAVASCRIPTCode:#nav li a:hover { background:#eaeaea; } #nav li a.selected { background:#eaeaea; }
// HTML + PHPCode:<script type="text/javascript"> $(document).ready(function () { $('#nav li').click(function(e){ e.preventDefault(); $('#nav li').removeClass("selected"); $(this).addClass('selected'); }); }); </script>
Can anyone help me out? Thanks in advanceCode:<ul id="nav"> <li><a href="?mod=colecao"><h3><?=lg_colecao?></h3></a></li> <li><a href="#"><h3><?=lg_lookbook?></h3></a></li> <li><a href="?mod=empresa"><h3><?=lg_empresa?></h3></a></li> <li><a href="?mod=downloads"><h3><?=lg_downloads?></h3></a></li> <li><a href="?mod=noticias" class="noticias"><h3><?=lg_noticias?></h3></a></li> <li><a href="?mod=contactos" class="contactos"><h3><?=lg_contactos?></h3></a></li> </ul> <div class="contents"> <?php include("mod/".$mod.".php"); ?> </div>



Reply With Quote

Bookmarks