PDA

View Full Version : HVmenu - filter:Alpha(opacity=80);?



DragonTheory
12-18-2006, 05:38 PM
1) Script Title: HV Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm

3) Describe problem: I would like to add some additional styling to the menus via CSS. Is that possible? Specifically, I would like to make the submenus semi-transparent using filter:Alpha(opacity=80);. Any help on how to do that with CSS or JavaScript would be very much appreciated. :)

jscheuer1
12-18-2006, 07:05 PM
Their are no convenient and exclusive styling hooks generated by this script for its generated menu elements.

The elements that you are looking for are all divisions. You can go into menu_com.js and find this:


if(DomYes){
var MmbrCntnr=Location.document.createElement("div");
MmbrCntnr.style.position='absolute';
MmbrCntnr.style.visibility='hidden';
if(RcrsLvl!=1){
MmbrCntnr.style.opacity='0.8';
MmbrCntnr.style.filter='alpha(opacity="80")';
}
Location.document.body.appendChild(MmbrCntnr)}

and add the red parts. This will take care of it for all modern browsers that support opacity.

You could instead add a class name there to make your own hook:


if(DomYes){
var MmbrCntnr=Location.document.createElement("div");
MmbrCntnr.style.position='absolute';
MmbrCntnr.style.visibility='hidden';
if(RcrsLvl!=1)
MmbrCntnr.className='HVsubs';
Location.document.body.appendChild(MmbrCntnr)}

Then you could us css style like:


.HVsubs {
filter:alpha(opacity="80");
opacity:0.8;
}

DragonTheory
12-18-2006, 08:08 PM
Thanks so much. That is exactly what I was looking for! :)