add check to getStyle to ensure provided element has a style attribute

This commit is contained in:
John Bintz 2010-01-06 19:43:10 -05:00
parent 5992866e46
commit 8a5b3209f4

View File

@ -1004,6 +1004,9 @@ Element.Methods = {
**/
getStyle: function(element, style) {
element = $(element);
if (!element.style)
return null;
style = style == 'float' ? 'cssFloat' : style.camelize();
var value = element.style[style];
if (!value || value == 'auto') {