Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/12/2013, 08:09
WorseMzg
 
Fecha de Ingreso: noviembre-2013
Mensajes: 78
Antigüedad: 10 años, 5 meses
Puntos: 4
cargar pagina dentro de div

buenos dias srs.

Tengo una duda, si quiero cargar informacion en un div desde otro archivo ocupo la siguiente funcion.

Código:
function nuevoAjax(){
	var xmlhttp=false;
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	  xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function consultatipo(tipo) {
  var ajax = nuevoAjax();
  ajax.open("GET", "pagina.php?var="+tipo, true);
  ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  ajax.onreadystatechange=function() {

	if (ajax.readyState != 4){
	  document.getElementById('div').innerHTML = "Cargando los Productos, espere un momento"
	}
	if (ajax.readyState==4) {
	  document.getElementById('div').innerHTML=ajax.responseText;
	}
  }
  ajax.send(null)
}
el codigo me funciona perfectamente, pero quisiera agregarle alguna manera de que la carga la hiciera con algun tipo de efecto de transicion como un fade o algo asi.

se puede utilizando con este codigo o hay otras maneras, segun lo que he averiguado esta manera es un poco antigua, alomejor con alguna libreria de jquery se puede hacer algo mas elegante


se agradece cualquier comentario ...