Código:
El ejemplo del funcionamiento del codigo puede verse en el mismo sitio web <html> <head> <title>ejemplo de rollover múltiple</title> <script language="JavaScript" type="text/javascript"> home=new Image(80,20); homeOn=new Image(80,20); html=new Image(80,20); htmlOn=new Image(80,20); java=new Image(80,20); javaOn=new Image(80,20); home.src="boton1off.gif"; homeOn.src="boton1on.gif"; html.src="boton2off.gif"; htmlOn.src="boton2on.gif"; java.src="boton3off.gif"; javaOn.src="boton3on.gif"; function cambia(nombre,activa) { document.images[nombre].src=activa.src; } </script> </head> <body> <P> <A href="#" onmouseout="cambia('primera',home);" onmouseover="cambia('primera',homeOn);" onclick="return false;"> <img name="primera" src="boton1off.gif" width="80" height="20" border="0" alt="home"> </A> <P> <A href="#" onmouseout="cambia('segunda',html);" onmouseover="cambia('segunda',htmlOn);" onclick="return false;"> <img name="segunda" src="boton2off.gif" width="80" height="20" border="0" alt="home"> </A> <P> <A href="#" onmouseout="cambia('tercera',java);" onmouseover="cambia('tercera',javaOn);" onclick="return false;"> <img name="tercera" src="boton3off.gif" width="80" height="20" border="0" alt="home"> </A> </P> </body> </html>
Código:
Lo que quiero saber es como deberia modificar el codigo para que se muestre el boton en el estado activo cuando me encuentro en cada seccion del sitio es decir si me encuentro en la seccion inicio el boton inicio este en el estado activo, si cambio a otra seccion el boton de dicha seccion se encuentre activo, esto tomando en cuenta que la botonera la incluyo en el sitio mediante un include de php para que sea mas sencillo incluirla en todas las secciones. http://www.vitaminaweb.com/javascript/articulos/001/imagenes5_ej.php