This project is archived and is in readonly mode.

#323 ✓wontfix
roxority

setStyle('height', '-1px') -- IE7 script error

Reported by roxority | August 18th, 2008 @ 03:02 PM | in 2.0 (closed)

Calling setStyle()with property 'height' and value '-1px' results in an script error message in IE 7 -- more precisely, the last line just before the return, this.style[property]=value; yields the script error -- mootools-1.2-core.js line 2019 in my build.

I didn't call this directly but did some morphs. Never from or to -1 values of course, seems like the Fx code is doing that. Anyway, my personal work-around for now is:

if(Browser.Engine.trident && value[0] == '-')

value = '0px';

Comments and changes to this ticket

  • roxority

    roxority August 18th, 2008 @ 10:06 PM

    That workaround was rubbish of course. Here's one that works:

    while(value.charAt(0) == '-')
        value = value.substr(1);
    
  • Jan Kassens

    Jan Kassens August 18th, 2008 @ 10:30 PM

    • State changed from “new” to “hold”

    'elastic' and 'back' go outside the specified range, so you can't use them to go from or to (depending) 0 or near 0 values for height. But we cant remove that support since margin for example can be negative. How does scriptaculous or other libs handle that case?

  • roxority

    roxority August 19th, 2008 @ 09:42 AM

    True, that's it. I used Bounce I think. Makes perfect sense and yes, shouldn't be changed. I used easeInOut but since in this case I know I'm morphing from 0 to some value > 0 I can just use easeIn or easeOut only (not sure which one right now, but only one instead of easeInOut for sure).

  • jollymoon

    jollymoon January 28th, 2010 @ 03:32 PM

    • Tag changed from 1.2, 1.2release, ie, minor, patch, trivial to ie, patch
    • Assigned user cleared.

    where do you put this code fix to stop the 2019 error and character 3 on line 2704? for mootools 1.2.js??
    give me a line # ??

    while(value.charAt(0) == '-')

    value = value.substr(1);
    

    I just hate seeing that error msg in my browser window...even though it doesn't show in FireFox 3.6 or Chrome 4.0.249.78

    Thanx!

  • jollymoon

    jollymoon January 28th, 2010 @ 05:03 PM

    line 2019 says:

    this.style[property] = value;
        return this;
    

    and line 2704 says:
    window.fireEvent('domready');
    document.fireEvent('domready');

    so which line is to be changed?

    A search of:
    while(value.charAt(0) == '-')

    value = value.substr(1);
    

    turns up no line numbers at all?

    My VERSION says:
    var MooTools = {

    'version': '1.2dev',
    'build': ''
    

    Does this make a difference? Is there a preferred download of mootools 1.2??

    just tryin' to make it... thanx!

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 07:25 PM

    • State changed from “hold” to “wontfix”
    • Milestone order changed from “0” to “0”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Tags

Pages