Hola a tod@s
Necesito ayuda con un popup menu con submenú en algunos enlaces, q hice para una página y q se activa con el evento onMouseOver, y tengo un par d problemillas con él:
1.- En algunas páginas hay animaciones flash, y cuando se abre este menú, se coloca debajo de la animación flash. Cómo hago para que esté en modo "Siempre visible", y que se ponga encima de la animación flash?
2.- Lo otro es que los submenús de este menú sólo se desactivan cuando el mouse sale hacia el "cuerpo" de la página, cuando el mouse pasa por otra selección del menú, o hacia la barra d navegación, no se desactiva, y a veces m queda el submenú flotando en la página...
A continuación coloco el código del menú y alguna d sus llamadas dentro de la página:
Esto es lo q va en el head de la página:
Código:
<style type="text/css">
#dropmenudiv{
position:absolute;
background:#878787;
border:1px solid #003f7c;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid #003f7c;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#ffffff;
}
#dropmenudiv a:hover{ /*hover background color*/
background:#878787;
color:#003f7c;
}
/* Sample CSS definition for the example list. Remove if desired */
.navlist li {
list-style-type: square;
width: 135px;
background-color: #FFFFB9;
}
#subdropmenudiv{
position:absolute;
background:#878787;
border:1px solid #003f7c;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}
#subdropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid #003f7c;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#ffffff;
}
#subdropmenudiv a:hover{ /*hover background color*/
background:#878787;
color:#003f7c;
}
/* Sample CSS definition for the example list. Remove if desired */
.subnavlist li {
list-style-type: square;
width: 135px;
background-color: #FFFFB9;
}
.Estilo8 {font-size: xx-small}
</style>
<script type="text/javascript" language="javascript" src="Scripts/AC_RunActiveContent.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="Scripts/stmenu.js"></script>
<script type="text/javascript">
/***********************************************
* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="organizacion.php">Nuestra Organización</a>'
menu1[1]='<a href="clientes.php">Nuestros Clientes</a>'
//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="productos.php" onMouseOver="dropdownmenu(this, event, menu4, \'165px\',1)" onMouseOut="delayhidemenu()">Tienda >></a>'
menu2[1]='<a href="servicios.php" onMouseOver="document.subdropmenudiv.style.visibility=\'hidden\'">Servicios</a>'
menu2[2]='<a href="portafolio.php" onMouseOver="dropdownmenu(this, event, menu5, \'165px\',1)" onMouseOut="delayhidemenu()">Portafolio >></a>'
menu2[3]='<a href="moviles.php">Soluciones Móviles</a>'
menu2[4]='<a href="web.php">Desarrollo Web</a>'
menu2[5]='<a href="cantv.php">Productos CANTV</a>'
var menu3=new Array()
menu3[0]='<a href="Images/Galeria/Red_Asuncion/asuncion.php">Internet Comunitario<br>Wi-Fi La Asunción</a>'
menu3[1]='<a href="Images/Galeria/Red_Choroni/choroni.php">Internet Comunitario<br>Wi-Fi Choroní</a>'
menu3[2]='<a href="Images/Galeria/Red_Ocumare/ocumare.php">Internet Comunitario<br>Wi-Fi Ocumare</a>'
var menu4=new Array()
menu4[0]='<a href="productos.php">Equipos de Escritorio</a>'
menu4[1]='<a href="productos.php">Laptops</a>'
menu4[2]='<a href="productos.php">Monitores</a>'
menu4[3]='<a href="productos.php">Cases</a>'
menu4[4]='<a href="productos.php">Palms y PDAs</a>'
menu4[5]='<a href="productos.php">Dispositivos de<br>Almacenamiento</a>'
menu4[6]='<a href="productos.php">Cámaras</a>'
menu4[7]='<a href="productos.php">Scanners</a>'
menu4[8]='<a href="productos.php">Impresoras</a>'
menu4[9]='<a href="productos.php">Redes</a>'
menu4[10]='<a href="productos.php">Cables y Accesorios</a>'
menu4[11]='<a href="productos.php">Periféricos</a>'
var menu5=new Array()
menu5[0]='<a href="nuevas_tecnologias.php">Plataforma para<br>Nuevas Tecnologías</a>'
menu5[1]='<a href="internet_comunitario.php">Internet Gubernamental</a>'
menu5[2]='<a href="video_vigilancia.php">Sistema de<br>Video-Vigilancia</a>'
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)
/////No further editting needed
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ie4||ns6){
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
document.write('<div id="subdropmenudiv" style="visibility:hidden;width: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
}
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}
function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}
function dropdownmenu(obj, e, menucontents, menuwidth,submenu){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
//if (submenu!=1)
clearhidemenu();
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv;
if (submenu==0)
dropmenuobj=document.getElementById? document.getElementById("subdropmenudiv") : subdropmenudiv;
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "topedge")+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}
function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
</script>
Y así es la llamada en una d las imágenes:
Código:
<div class="productos">
<a onMouseOver="dropdownmenu(this, event, menu2, '165px',0)" onMouseOut="delayhidemenu()">
<img src="images/productos.png" alt="PRODUCTOS Y SERVICIOS" width="172" height="35" border="0" id="Image3" onMouseOver="MM_swapImage('Image3','','Images/productos_over.png',1)" onMouseOut="MM_swapImgRestore()"></a> </div>
Si me pueden ayudar con esto, estaría d verdad agradecido, me urge.
Saludos