mootools/mootools-core — Issue #2233: setStyle() negative value and IE7
Author: ibolmo
Created: 2012-01-19 09:46:50+00:00
State: open
Labels: bug

(from [Lighthouse](https://mootools.lighthouseapp.com/projects/2706/tickets/1231-setstyle-negative-value-and-ie7))

Some softs developped with mootools calculate the height / margin, etc. of DOM elements and set them through the Element.setStyle() function.

Sometime, the sended value can be negative.
Modern browsers don't care but IE7 fired an error : "Member not found" at line 3566. (test on margin)

The solution could be to replace, in Element.setStyle declaration :

this.style[property] = value;
by

try {
this.style[property] = value;
}
catch(e){}
... or to set the nagative margin value to 0...

----

Example available here :
http://partikule.partikule.net/mootools_setstyle_bug/index.html
This example should be open with IE8 and IE7.