Just tested slideDown, it exhibits the same behavior. I've put in
essentially the same fix but it seems to have a horizontal positioning
problem if the element starts out hidden until the element is
completely revealed.
/** @id MochiKit.Visual.slideDown */
MochiKit.Visual.slideDown = function (element, /* optional */ options)
{
/***
Slide an element down.
It needs to have the content of the element wrapped in a container
element with fixed height.
***/
var d = MochiKit.DOM;
var b = MochiKit.Base;
var s = MochiKit.Style;
element = d.getElement(element);
if (!element.firstChild) {
throw "MochiKit.Visual.slideDown must be used on a element
with a child";
}
d.removeEmptyTextNodes(element);
var oldInnerBottom = s.getStyle(element.firstChild, 'bottom') ||
0;
var elemClip;
options = b.update({
scaleContent: false,
scaleX: false,
scaleFrom: 0,
restoreAfterFinish: true,
beforeSetupInternal: function (effect) {
elemClip = d.makeClipping(effect.element);
s.showElement(effect.element);
scaleMode = {originalHeight: s.getElementHeight(element),
originalWidth: s.getElementWidth(element)},
},
afterSetupInternal: function (effect) {
d.makePositioned(effect.element);
d.makePositioned(effect.element.firstChild);
if (/Opera/.test(navigator.userAgent)) {
s.setStyle(effect.element, {top: ''});
}
s.setStyle(effect.element, {height: '0px'});
},
afterUpdateInternal: function (effect) {
s.setStyle(effect.element.firstChild,
{bottom: (effect.dims[0] -
s.getElementHeight(effect.element)) + 'px'});
},
afterFinishInternal: function (effect) {
d.undoClipping(effect.element, elemClip);
// IE will crash if child is undoPositioned first
if (/MSIE/.test(navigator.userAgent)) {
d.undoPositioned(effect.element);
d.undoPositioned(effect.element.firstChild);
} else {
d.undoPositioned(effect.element.firstChild);
d.undoPositioned(effect.element);
}
s.setStyle(effect.element.firstChild, {bottom:
oldInnerBottom});
}
}, options);
return new MochiKit.Visual.Scale(element, 100, options);
};
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---