problema explorer-netscape
Publicado por peredinha (4 intervenciones) el 03/10/2007 00:29:01
tengo el programa para mover las capas pero ahora solo me funciona en el explorer
tengo un problema a la hora de convertir este tipo de funcion del progrma dos(solo funciona en explorer)
function MueveCapa(){
var antx;
//limite inferior
var limited=300;
//Pos actual
antx= parseInt(capa1.style.left);
if (antx < limited){
//paso = 0;
capa1.style.left= antx + paso;
setTimeout("MueveCapa()",5);
}
a este otro metodo (que uso en el programa 1) (funciona en explorer y netscape)
function mover(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-1;
aqui estan mis dos programas al completo:
PROGRAMA 1 (FUNCIONES MOVEMENU PARA EXPLORER)
(FUNCIONES MOVER PARA MOZILLA Y NETSCAPE)
<html>
<head>
<script language="JavaScript1.2">
function moveMenu(){
divMenu.style.left=-1
divMenu2.style.left=-1
divMenu.style.zIndex=0
divMenu2.style.zIndex=1
}
function moveMenu1(){
divMenu.style.left=-495;
divMenu2.style.left=-495;
divMenu.style.zIndex=1
divMenu2.style.zIndex=0
}
function mover(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-1;
document.getElementById(divMenu2).style.left=-1;
document.getElementById(divMenu).style.zIndex=0;
document.getElementById(divMenu2).style.zIndex=1;
}
function mover2(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-600;
document.getElementById(divMenu2).style.left=-600;
document.getElementById(divMenu).style.zIndex=1;
document.getElementById(divMenu2).style.zIndex=0;
}
</script>
<title>Pagina nueva 1</title>
</head>
<body>
<div id="divMenu" style="position:absolute; top:147; left:-600; width:654; background-color:F0F0F0; z-index:1 ">
<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<td>Sjhjj </td>
<td>Akgkhk </td>
<td>Chjkk </td>
<td>Ehgjhgh </td>
<td>COkkkkgh </td>
<td>MOkhk </td>
<td>Fjghjh </td>
<td><a onmouseover="mover('divMenu','divMenu2')" style="background-color:yellow;text-decoration:none">MENU</a>
</table>
</div>
<div id="divMenu2" style="position:absolute; top:147; left:-600; width:654; background-color:F0F0F0; z-index:0">
<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<td>Sjhjj </td>
<td>Akgkhk </td>
<td>Chjkk </td>
<td>Ehgjhgh </td>
<td>COkkkkgh </td>
<td>MOkhk </td>
<td>Fjghjh </td>
<td><a onmouseover="mover2('divMenu','divMenu2')" style="background-color:yellow;text-decoration:none">MENU</a>
</table>
</div>
</body>
</html>
PROGRMA 2(LE QUIERO APLICAR el metodo de LAS FUNCIONES MOVER())
<HTML><HEAD><TITLE>Página con Filtros</TITLE>
</HEAD>
<BODY>
<SCRIPT language=JavaScript>
<!--
var paso=5;
function MueveCapa(){
var antx;
//limite inferior
var limited=300;
//Pos actual
antx= parseInt(capa1.style.left);
if (antx < limited){
//paso = 0;
capa1.style.left= antx + paso;
setTimeout("MueveCapa()",5);
}
return true;
}
function DevuelveCapa(){
capa1.style.left=-50;
return true;
}
//-->
</SCRIPT>
<CENTER>
<H3>Pantalla de Movimiento y Filtros</H3></CENTER>
<DIV id=capa1 style="top: 20px; POSITION: absolute; TOP: 50px; VISIBILITY: visible; Z-INDEX: 1;left:-50">
<IMG height=110 id=imagen src="moj1.jpg" width=75> </DIV>
<DIV id=capa2 style="top: 20px; POSITION: absolute; TOP: 200px; VISIBILITY: visible; Z-INDEX: 2">
<FORM name=miform>
<INPUT onclick="return MueveCapa();" type=button value="Mover Imagen">
<INPUT onclick="return DevuelveCapa();" type=button value="Situar Imagen">
</FORM></DIV></BODY></HTML>
tengo un problema a la hora de convertir este tipo de funcion del progrma dos(solo funciona en explorer)
function MueveCapa(){
var antx;
//limite inferior
var limited=300;
//Pos actual
antx= parseInt(capa1.style.left);
if (antx < limited){
//paso = 0;
capa1.style.left= antx + paso;
setTimeout("MueveCapa()",5);
}
a este otro metodo (que uso en el programa 1) (funciona en explorer y netscape)
function mover(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-1;
aqui estan mis dos programas al completo:
PROGRAMA 1 (FUNCIONES MOVEMENU PARA EXPLORER)
(FUNCIONES MOVER PARA MOZILLA Y NETSCAPE)
<html>
<head>
<script language="JavaScript1.2">
function moveMenu(){
divMenu.style.left=-1
divMenu2.style.left=-1
divMenu.style.zIndex=0
divMenu2.style.zIndex=1
}
function moveMenu1(){
divMenu.style.left=-495;
divMenu2.style.left=-495;
divMenu.style.zIndex=1
divMenu2.style.zIndex=0
}
function mover(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-1;
document.getElementById(divMenu2).style.left=-1;
document.getElementById(divMenu).style.zIndex=0;
document.getElementById(divMenu2).style.zIndex=1;
}
function mover2(divMenu,divMenu2){
document.getElementById(divMenu).style.left=-600;
document.getElementById(divMenu2).style.left=-600;
document.getElementById(divMenu).style.zIndex=1;
document.getElementById(divMenu2).style.zIndex=0;
}
</script>
<title>Pagina nueva 1</title>
</head>
<body>
<div id="divMenu" style="position:absolute; top:147; left:-600; width:654; background-color:F0F0F0; z-index:1 ">
<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<td>Sjhjj </td>
<td>Akgkhk </td>
<td>Chjkk </td>
<td>Ehgjhgh </td>
<td>COkkkkgh </td>
<td>MOkhk </td>
<td>Fjghjh </td>
<td><a onmouseover="mover('divMenu','divMenu2')" style="background-color:yellow;text-decoration:none">MENU</a>
</table>
</div>
<div id="divMenu2" style="position:absolute; top:147; left:-600; width:654; background-color:F0F0F0; z-index:0">
<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<td>Sjhjj </td>
<td>Akgkhk </td>
<td>Chjkk </td>
<td>Ehgjhgh </td>
<td>COkkkkgh </td>
<td>MOkhk </td>
<td>Fjghjh </td>
<td><a onmouseover="mover2('divMenu','divMenu2')" style="background-color:yellow;text-decoration:none">MENU</a>
</table>
</div>
</body>
</html>
PROGRMA 2(LE QUIERO APLICAR el metodo de LAS FUNCIONES MOVER())
<HTML><HEAD><TITLE>Página con Filtros</TITLE>
</HEAD>
<BODY>
<SCRIPT language=JavaScript>
<!--
var paso=5;
function MueveCapa(){
var antx;
//limite inferior
var limited=300;
//Pos actual
antx= parseInt(capa1.style.left);
if (antx < limited){
//paso = 0;
capa1.style.left= antx + paso;
setTimeout("MueveCapa()",5);
}
return true;
}
function DevuelveCapa(){
capa1.style.left=-50;
return true;
}
//-->
</SCRIPT>
<CENTER>
<H3>Pantalla de Movimiento y Filtros</H3></CENTER>
<DIV id=capa1 style="top: 20px; POSITION: absolute; TOP: 50px; VISIBILITY: visible; Z-INDEX: 1;left:-50">
<IMG height=110 id=imagen src="moj1.jpg" width=75> </DIV>
<DIV id=capa2 style="top: 20px; POSITION: absolute; TOP: 200px; VISIBILITY: visible; Z-INDEX: 2">
<FORM name=miform>
<INPUT onclick="return MueveCapa();" type=button value="Mover Imagen">
<INPUT onclick="return DevuelveCapa();" type=button value="Situar Imagen">
</FORM></DIV></BODY></HTML>
Valora esta pregunta


0