Hiyall,
If I just want to change the x-position or the height of an element, I
can't use the setElementPosition/Dimensions function. How about an API
extension where you can pass null for an argument and that argument
will not be updated? (another option would be to add setElementHeight
and setElementWidth).
Simple usage example in an onresize handler:
setElementDimensions(fixedwidthelement,
{w:null, h: getViewportDimensions().h});
Implementation (based on current setElementPosition):
setElementPosition = function (elem, newPos/* optional */, units) {
elem = MochiKit.DOM.getElement(elem);
if (typeof(units) == 'undefined') {
units = 'px';
}
var style = {};
if (newPos.x!==null) style.left = newPos.x + units;
if (newPos.y!==null) style.top = newPos.y + units;
MochiKit.DOM.updateNodeAttributes(elem, {'style': style});
};
Same for setElementDimension.
I can supply a patch if anyone is interested.
Ciao, Marc.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---