This is the way I'd approach it, this way the object is self-contained and the method is re-useable.

I just put "ceilWidth" as an additional Param, you could do both width, height, zIndex and so on. Just make sure the "obj" param is feed each time.

Regards
Scott Barnes
http://macrofun.pvpers.com


Code Here... --------------------------


<img src="logo.gif" width="276" height="110" alt="" id="myLogo" name="myLogo" border="0">


<script>
function increaseSize(obj,ceilWidth) {

  // Saftey Catch
  if (typeof obj != "object") {
    alert('Error: no Object Found');
    return;
  }

  // Increase Amount
  obj.width += 10;
        obj.height += 10;
        
  // Add Additional Propery to the Object, so its Self Contained
        if (typeof obj.ceilWidth == "undefined") {
                obj.ceilWidth = new Number(ceilWidth);
        }                       
        
  // Once it reaches the additional Properties ceiling, dump out.
        if (obj.ceilWidth >= obj.width) {
                setTimeout("increaseSize(" + obj.name + ")",1000);  
        } else {
    alert('finished');
  }
        
}
increaseSize(document.myLogo,300);

</script>

Steve Onnis wrote:
anyone?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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/

Reply via email to