$(function() { $('#side-link a').click(function() { $('#side-link a').removeClass('cur'); $(this).addClass('cur'); }); });
<!DOCTYPE html> <html> <head> <title>Website : Gallery</title> ... <script type="text/javascript"> $(function() { $('#side-link a').click(function() { $('#side-link a').removeClass('cur'); $(this).addClass('cur'); }); }); </script> </head> <body> <header id="hd_wrapper" class="hd_wrap"> <div id="nav_div"> .... </div> </header> ... <section id="main1"> <section id ="main_content"> <section id ="contents"> <section id="news_pub"> <aside class ="contact_gal"> <div id="side-link"> <h2>Categories</h2> <ul> <li><a href="gallery.php?content=gal1" class="cur" name="content" value="gal1"> Example1 </a></li> <li><a href="gallery.php?content=gal2" class="" name="content" value="gal2"> Example2 </a></li> <li><a href="gallery.php?content=gal3" class="" name="content" value="gal3"> Example3 </a></li> <li><a href="gallery.php?content=gal4" class="" name="content" value="gal4"> Example4 </a></li> <li><a href="gallery.php?content=gal5" class="" name="content" value="gal5"> Example5 </a></li> <li><a href="gallery.php?content=gal6" class="" name="content" value="gal6"> Example6 </a></li> <li><a href="gallery.php?content=gal7" class="" name="content" value="gal7"> Example7 </a></li> </ul> </div> <div id="o_uqiness"> ... </div> </aside> <section id="n_pub2"> <div> <?php if (isset($_GET['content'])){ switch ($_GET['content']) { case 'gal2': include('gal2.html'); break; case 'gal3': include('gal3.html'); break; case 'gal4': include('gal4.html'); break; case 'gal5': include('gal5.html'); break; case 'gal6': include('gal6.html'); break; case 'gal7': include('gal7.html'); break; case 'gal1': include('gal1.html'); break; default: include('gal1.html'); break; } } else //no link has been clicked include('gal1.html'); ?> </div> </section> </section> </section> </section> </section> <footer id=ft> <section id="ft_container"> <p>Ex. © <script type="text/javascript"> var today=new Date(); document.write(today.getFullYear()); </script> <noscript>2014</noscript> </p> </section> </footer> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)