Active Menu Item


hi there.

 

i'm going making site pretty menu has menu items consisting of tabbed images (i might use jquery script instead), when hover, change colour giving typical button effect.

 

i wondered, how show different colour when user on page.

 

does make sense.?

 

thanks,

craig

using spry framework have following in head section of document

<script src="spryassets/sprydomutils.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
function initpage() {
spry.$$('#menubar1 li').foreach(function(node){
     var a=node.getelementsbytagname("a")[0]; // finds elements inside li, want first [0]
     if(a.href == window.location){
         spry.utils.addclassname(node,"activemenuitem");
     }
});
}
spry.utils.addloadlistener(initpage);
</script>
 
<style type="text/css">
.activemenuitem {
     font-weight: bold;
}
</style>

the above finds list item same href url, turns font bold. similar code can show different background colour or different image.



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい