|
Something like this ought to do it pretty nicely. <img id="img" src="" class="moz-txt-link-rfc2396E" href="http://www.google.com.au/intl/en_au/images/logo.gif">"http://www.google.com.au/intl/en_au/images/logo.gif"> <script> alert(document.getElementById('img').width); function resize(img,xIncrement,yIncrement,maxWidth) { img.width += xIncrement; img.height += yIncrement; if(img.width < maxWidth) { setTimeout('callResize()',500) } alert(document.getElementById('img').width); } function callResize() { resize(document.getElementById('img'),1,1,300) } callResize(); </script> Spike Steve Onnis wrote: i have an image and i have a _javascript_ object which contains things like the original size of the image and the size it needs to get to, then I call this recursive function to increase the size of the image till it reaches it required size.so i pass in "obj" being the image object and "params" being the object I have created. so each time the function is called it needs to pass in the new data. I dont want to if possible have to create a bunch of global vars. I only want to have what I need outside the functions Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Spike Sent: Tuesday, August 19, 2003 4:51 PM To: CFAussie Mailing List Subject: [cfaussie] RE: OT : _javascript_ It might be a better idea to explain exactly what you're trying to do rather than posting a small snippet. From what I can see you've probably taken the wrong approach, but suggesting a better one is a bit tricky without a better understanding of the whole picture. Spike Steve Onnis wrote:anyone? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve Onnis Sent: Tuesday, August 19, 2003 3:11 AM To: CFAussie Mailing List Subject: [cfaussie] OT : _javascript_ Hey guys anyone able to help me with this? function increaseSize(obj,params) { //alert(obj.width); obj.width = obj.width+10; obj.height = obj.height+10; if (params.endWidth >= obj.width) {setTimeout("increaseSize(" + obj + "," + params +")",1000);} } basically i need to recall the function but keep passing the original arguments back into the function. cant seem to get it to trigger Any ideas? Regards Steve --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to[EMAIL PROTECTED]MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to[EMAIL PROTECTED]MX Downunder AsiaPac DevCon - http://mxdu.com/-- Stephen Milligan Consultant for hire http://www.spike.org.uk --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ -- Stephen Milligan Consultant for hire http://www.spike.org.uk--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ |
- [cfaussie] RE: OT : JavaScript Steve Onnis
- [cfaussie] RE: OT : JavaScript Steve Baty
- [cfaussie] RE: OT : JavaScript Steve Onnis
- [cfaussie] RE: OT : JavaScript Steve Baty
- [cfaussie] RE: OT : JavaScript FLEUR, Taco
- [cfaussie] RE: OT : JavaScript Spike
- [cfaussie] RE: OT : JavaScript Steve Onnis
- [cfaussie] RE: OT : JavaScript Steve Onnis
- [cfaussie] RE: OT : JavaScript Spike
- [cfaussie] RE: OT : JavaScript Steve Onnis
- [cfaussie] Re: OT : JavaScript Spike
- [cfaussie] Re: OT : JavaScript Scott Barnes
