IE Invalid Argument... sometimes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andrewferk@gmail.com

    IE Invalid Argument... sometimes

    The following code is stored inside a div element.

    Movable.prototy pe.moveTimer = function() {
    this.style.left = (this.offsetLef t - (this.posX - this.newX)) + "px";
    this.style.top = (this.offsetTop - (this.posY - this.newY)) + "px";
    this.posX = this.newX;
    this.posY = this.newY;
    }

    every 40 ms it is called by a timer.

    var self = this;
    this.timer = setInterval(fun ction(){self.mo veTimer()},40);

    It works all the time in Firefox. Sometimes in IE it says it gets an
    invalid argument here:

    -->|this.style.le ft = (this.offsetLef t - (this.posX - this.newX)) +
    "px";

    The code moves the div element with a mouse click and drag. After I
    get the error I can try to drag it again and it will drag. Sometimes
    it will not get the error. So it's like... random?

    Any help would be great. Thanks
  • Thomas 'PointedEars' Lahn

    #2
    Re: IE Invalid Argument... sometimes

    andrewferk@gmai l.com wrote:
    The following code is stored inside a div element.
    >
    Movable.prototy pe.moveTimer = function() {
    this.style.left = (this.offsetLef t - (this.posX - this.newX)) + "px";
    this.style.top = (this.offsetTop - (this.posY - this.newY)) + "px";
    this.posX = this.newX;
    this.posY = this.newY;
    }
    >
    every 40 ms it is called by a timer.
    >
    var self = this;
    this.timer = setInterval(fun ction(){self.mo veTimer()},40);
    >
    It works all the time in Firefox. Sometimes in IE it says it gets an
    invalid argument here:
    >
    -->|this.style.le ft = (this.offsetLef t - (this.posX - this.newX)) +
    "px";
    >
    The code moves the div element with a mouse click and drag. After I
    get the error I can try to drag it again and it will drag. Sometimes
    it will not get the error. So it's like... random?
    Welcome to MSHTML. That said, you should not augment host objects; if you
    have the need to do that, use a wrapper object instead.


    PointedEars
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann

    Comment

    Working...