This could be useful for parsing Element#getStyle results (to get rid
of "px")

parseInt(element.getStyle('left'));
// vs.
element.getStyle('left').parseInt();

I don't think it's a significant difference though. Moreover, getStyle
could return null and we all know what happens then. Speaking about
getStyle and parseInt, we had to do a little trick in Prototype UI:

Element.addMethods({
  getNumStyle: function(element, style) {
    var value = parseInt($(element).getStyle(style));
    return isNaN(value) ? null : value;
  }
})

- kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to