Hola tengo este codigo que me a costado descubrir, soy nuevo en esto....
y ahora resulta que no me funciona el tiempo, o sea ejecuta la funcion pero no con el interbalo de tiempo que le pongo, alguien puede charle un vistazo haber donde he metido la pata?
Código:
<?php
$inicio=400;
$finalc=701;
$imagen='img2/sarobe002.jpg'; ?>
<div id=argazkia><div id=img><img src=img2/sarobe002.jpg ></div></div>
<a href=# onclick="javascript:getImgSize('img2/sarobe002.jpg')">ghjsjjk</a>
<script language='JavaScript'>
function getImgSize(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
alert(width);
widthresize(400,width);
}
function widthresize(width2,topwidth){
var initial=width2;
var topwidth=topwidth;
//alert('top'+topwidth);
var nexwidth=initial+20;
//alert(nexwidth);
document.getElementById("argazkia").style.width = nexwidth+'px';
if(initial > topwidth){ alert('egina');}else{setTimeout( widthresize(nextwidth,topwidth), 100 );
};
}
</script>
</body>
</html>