corillo181 Posted December 18, 2007 Share Posted December 18, 2007 hi, i'm trying to make something like a div heights big bigger slowly. the code i try to use is function showSub(id){ for( var i = 0 ; i <= 500 ; i++ ){ setTimeout( document.getElementById(id).style.height = i+"px" , 10*i); } } Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted December 18, 2007 Share Posted December 18, 2007 here's a quick one, but you ought to check out SPRY, i use it, you can see it on my website or check out SPRY here http://labs.adobe.com/technologies/spry/demos/ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <div id="box" style="visibility:visible;width:200px;height:150px;top:225;left:300;position:absolute;background:white;z-index:20;border:1px black solid;"> </div> <input type="button" value="Grow!" onClick="doGrow()"> <script language="JavaScript" type="text/javascript"> <!-- var oLvl = 00; var oEnd = 75; var vwidth = 200; var vheight = 150; var vtop = 225; var vleft = 300; var obj = document.getElementById('box') function doGrow() { oLvl++ if (oLvl < oEnd) { obj.style.width = vwidth++ +"px"; obj.style.height = vheight++ +"px"; obj.style.top = vtop-- +"px"; obj.style.left = vleft-- +"px"; setTimeout('doGrow()',5); } } // --> </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.