Prototype setStyle not working in IE6.
- by Smickie
Hi,
I'm using prototype and setStyle in IE6 is just messing everything up. It's throwing a big error.
I've Googled it but cant find a solution.
I've identified the line in prototype with the IE script debugger, it's the final else block:
setStyle: function(element, styles) {
element = $(element);
var elementStyle = element.style, match;
if (Object.isString(styles)) {
element.style.cssText += ';' + styles;
return styles.include('opacity') ?
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
}
for (var property in styles)
if (property == 'opacity') element.setOpacity(styles[property]);
else
elementStyle[(property == 'float' || property == 'cssFloat') ?
(Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
property] = styles[property];
return element;
},
Anyone had this problem?
P.S. normally I would use jQuery however this is someone else code I've had to update.