Romulus
01-31-2003, 08:10 PM
I've been trying to make a NavBar in a <div> on page that I'm playing around with in DW MX that will have buttons which are semi-transparent, so the user can still see the image that they are over top of. However, I put a test page together and the whole NavBar doesn't show up.
I've put a style sheet in the page to try to get the transparency efffect and then used the class="" in the <div>
to try to get it to work....But no NavBar...at all.
I included the code below. I've also bolded the CSS and the <div>...the other parts are images and the script for the rollovers, etc.
---------------
<html>
<head>
<title>Untitled Document</title>
<style>
.transparent
{
-moz-opacity:0.95;
filter:alpha(opacity=95);
}
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="MM_preloadImages('Images/HomeButtonOver.gif','Images/BioButtonOver.gif','Images/PicButtonOver.gif','Images/ContactButtonOver.gif')">
<div id="MenuLayer" class="transparent" style="position:absolute; width:760px; height:25px; z-index:99; left: 0px; top: 110px; visibility: hidden">
<table border="0" cellpadding="0" cellspacing="0" class="transparent" width="760" height="25" align="left">
<tr align="left">
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','one','',1)" onMouseOver="MM_nbGroup('over','one','Images/HomeButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/HomeButton.gif" alt="" name="one" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','two','',1)" onMouseOver="MM_nbGroup('over','two','Images/BioButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/BioButton.gif" alt="" name="two" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','three','',1)" onMouseOver="MM_nbGroup('over','three','Images/PicButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/PicButton.gif" alt="" name="three" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','four','',1)" onMouseOver="MM_nbGroup('over','four','Images/ContactButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/ContactButton.gif" alt="" name="four" width="125" height="23" border="0" onload=""></a></td>
</tr>
</table>
</div>
<table width="760" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="65" colspan="2" valign="top" bgcolor="#333333"><img src="Images/Logo.gif" width="370" height="65" /></td>
</tr>
<tr>
<td width="198" height="355" valign="top" bgcolor="#000000"><img src="Images/man1.jpg" width="144" height="350" /></td>
<td width="562" valign="top" bgcolor="#000000"><!--DWLayoutEmptyCell--> </td>
</tr>
</table>
</body>
</html>
-------------------------------------
Can anyone tell me how to get this effect figured out???
I've put a style sheet in the page to try to get the transparency efffect and then used the class="" in the <div>
to try to get it to work....But no NavBar...at all.
I included the code below. I've also bolded the CSS and the <div>...the other parts are images and the script for the rollovers, etc.
---------------
<html>
<head>
<title>Untitled Document</title>
<style>
.transparent
{
-moz-opacity:0.95;
filter:alpha(opacity=95);
}
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="MM_preloadImages('Images/HomeButtonOver.gif','Images/BioButtonOver.gif','Images/PicButtonOver.gif','Images/ContactButtonOver.gif')">
<div id="MenuLayer" class="transparent" style="position:absolute; width:760px; height:25px; z-index:99; left: 0px; top: 110px; visibility: hidden">
<table border="0" cellpadding="0" cellspacing="0" class="transparent" width="760" height="25" align="left">
<tr align="left">
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','one','',1)" onMouseOver="MM_nbGroup('over','one','Images/HomeButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/HomeButton.gif" alt="" name="one" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','two','',1)" onMouseOver="MM_nbGroup('over','two','Images/BioButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/BioButton.gif" alt="" name="two" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','three','',1)" onMouseOver="MM_nbGroup('over','three','Images/PicButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/PicButton.gif" alt="" name="three" width="125" height="23" border="0" onload=""></a></td>
<td align="left"><a href="javascript:;" target="_top" onClick="MM_nbGroup('up','group1','four','',1)" onMouseOver="MM_nbGroup('over','four','Images/ContactButtonOver.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images/ContactButton.gif" alt="" name="four" width="125" height="23" border="0" onload=""></a></td>
</tr>
</table>
</div>
<table width="760" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="65" colspan="2" valign="top" bgcolor="#333333"><img src="Images/Logo.gif" width="370" height="65" /></td>
</tr>
<tr>
<td width="198" height="355" valign="top" bgcolor="#000000"><img src="Images/man1.jpg" width="144" height="350" /></td>
<td width="562" valign="top" bgcolor="#000000"><!--DWLayoutEmptyCell--> </td>
</tr>
</table>
</body>
</html>
-------------------------------------
Can anyone tell me how to get this effect figured out???