CSS: CSS
# PL # pl_menu {}
. Plmenu_head {Height: 20px; padding: 10px 0 0 20px; width: 180px; font-weight: bold; Background: transparent URL (.. /image/web/LP/menu_head.gif) No-repeat scroll 0 ;}
. Plmenu_select {Background: transparent URL (.. /image/web/LP/menu_select.gif) No-repeat scroll 0; Height: 26px; line-Height: 26px; text-indent: 30px ;}
. Plmenu_normal {Background: transparent URL (.. /image/web/LP/menu_normal.gif) No-repeat scroll 0; Height: 26px; line-Height: 26px; text-indent: 30px ;}
. Plmenu_bottom {Background: transparent URL (../image/web/LP/menu_bottom.gif) No-repeat scroll 0; margin-top:-2px ;}
HTML: HTML
<Div class = "plmenu_head"> about us </div>
<Div id = "aboutus_menu" class = "plmenu_normal"> <a class = "head_link" href = "aboutus.html"> about us </a> </div>
<Div id = "companynews_menu" class = "plmenu_normal"> <a class = "head_link" href = "companynews.html"> company news </a> </div>
<Div id = "hr_menu" class = "plmenu_normal"> <a class = "head_link" href = "hr.html"> job opportunities </a> </div>
<Div id = "clientlist_menu" class = "plmenu_normal"> <a class = "head_link" href = "clientlist.html"> our customers </a> </div>
<Div id = "link_menu" class = "plmenu_normal"> <a class = "head_link" href = "link.html"> Links </a> </div>
<Div id = "contact_menu" class = "plmenu_normal"> <a class = "head_link" href = "contact.html"> Contact Us </a> </div>
<Div id = "" class = "plmenu_bottom"> </div>
JS: JS
<SCRIPT type = "text/JavaScript">
Window. onload = function ()
{
Setmenubackground ();
}
Function setmenubackground ()
{
VaR url = Document. url; // obtain the URL of the current page
If (/contact/. Test (URL. tolowercase () // regular query whether the current page exists in the URL address
{
$ ("# Contact_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
} Else if (/aboutus/. Test (URL. tolowercase ()))
{
$ ("# Aboutus_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
} Else if (/link/. Test (URL. tolowercase ()))
{
$ ("# Link_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
} Else if (/clientlist/. Test (URL. tolowercase ()))
{
$ ("# Clientlist_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
} Else if (/HR/. Test (URL. tolowercase ()))
{
$ ("# Hr_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
} Else if (/companynews/. Test (URL. tolowercase ()))
{
$ ("# Companynews_menu"). removeclass ("plmenu_normal"). addclass ("plmenu_select ");
}
}
</SCRIPT>