Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2009, 16:26
mikelatx
 
Fecha de Ingreso: agosto-2008
Mensajes: 29
Antigüedad: 16 años, 8 meses
Puntos: 0
cambiar atributo css progresibo

Hola, haber si alguien se anima aecharme una mano , que tengo la cabeza perdia.
al tajo.
teng oun div donde le voy a cargar una foto
Código:
#argazkia {
background-image : url('images/loading.gif');
background-position : center center;
background-repeat : no-repeat;
border: 1px solid #FFF;
margin:auto;
width:400px;
height:400px;}
tengo el div con la foto insertado dentro pero escondido.
Código:
#img { 
visibility:hidden;

  }
Lo que me gustaria seria una ver cargada la foto acerla aparecer, pero primero agrandar el div argazkiak al tamaño de lafo

Código:
function getImgSize(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
var inicio=400;
var heightpx = height+10+'px';
var widthpx = width+10+'px';
var widthtop = width+10;
var heighttop = height+10;
do { 
inicio=inicio+10;
document.getElementById('argazkia').style.width = inicio;

}while ( inicio < widthtop);

do { 
inicio=inicio+10;
document.getElementById('argazkia').style.height = inicio;

}while ( inicio < heighttop);
 };
con esta funcion consig oque el div coja la anchura y altura necesaria pero lo hace de golpe, me gustaria poder hacerlo progresibo, no se ne 1500 milisegundos o hasi....
he probado con settimeout pero no lo consigo.......alguien puede echarme una mano?,