Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/06/2008, 21:59
KekoGrama
 
Fecha de Ingreso: septiembre-2006
Mensajes: 127
Antigüedad: 18 años, 5 meses
Puntos: 5
Aproblemado con script de pestañas

La cosa esq necesito que al momento de seleccionar otra pestaña, la que estaba seleccionada anteriormente, vuelva al estilo (o fondo) que tiene por defecto. El script que les muestro a continuación, lo que hace es cambiar el fondo de la pestaña, pero cuando selecciono otra pestaña, esta no cambia al fondo anterior.

Código HTML:
function getXMLHttpRequest(){var aVersions=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];if(window.XMLHttpRequest){return new XMLHttpRequest()}else if(window.ActiveXObject){for(var i=0;i<aVersions.length;i++){try{var oXmlHttp=new ActiveXObject(aVersions[i]);return oXmlHttp}catch(error){}}}}

function cargar_p(v) {
 capa = document.getElementById('Stats');
 boton = document.getElementById(v);
 capa.innerHTML = '<img src="load.gif" alt="Cargando...">';
 ajax = getXMLHttpRequest();
 ajax.open("GET", "mods/pStats.php?v="+v);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
   capa.innerHTML = ajax.responseText;
   boton.style.background = "url('images/lihover.jpg') repeat-x";
  }
 }
 ajax.send(null);
}
Adiós!