Hi everybody,

In some browsers (Firefox, Opera, etc.) border-width and padding are
added to the width and height of the div.
This is not what I want when I set width and height of a div, so
actually width = width - 2*border-width - 2*padding, and height =
height - 2*border-width - 2*padding.
If border-style is 'none', I ignore border-width in calculations.

Wouldn't it be nice if MochiKit.setElementDimensions figured out the
boxing model differences for us by means of the MochiKit.Base.isIe,
isGecko, isKHTML, isSafari and isOpera functions (when the element is a
div)?

As far as I can see, the MochiKit.setElementDimensions function only
updates the style attributes.

    /** @id MochiKit.Style.setElementDimensions */
    setElementDimensions: function (elem, newSize/* optional */, units)
{
        elem = MochiKit.DOM.getElement(elem);
        if (typeof(units) == 'undefined') {
            units = 'px';
        }
        MochiKit.DOM.updateNodeAttributes(elem, {'style': {
            'width': newSize.w + units,
            'height': newSize.h + units
        }});
    },

Am I missing something here? Please let me know what you think of it.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to