将 mootools fx.morph 高度设置为自动而不是固定高度
setting mootools fx.morph height to auto instead of a fix height
我正在尝试使用 fx.morph 显示我的导航,代码如下:
var fx = new Fx.Morph(_element, {
duration: 1000,transition:Fx.Transitions.Sine.easeOut
});
fx.start({
'height': [0, 100]
});
}
效果很好,我需要的是将高度从 0 设置为自动,而不是将 0 设置为 100.is 有什么解决方案吗?我尝试了自动和 100%,但没有用.
我已经做到了myself.I只需添加一个容器,然后计算该容器的高度并将其作为高度。
var _element = el.getElement('.child_first_nav_mobile');
if (_element) {
var fx = new Fx.Morph(_element, { duration: 1000 });
var autoheightdiv = _element;
autoheightdiv.style.height='auto';
var calcheight=autoheightdiv.offsetHeight
fx.start({
'height': [0, calcheight]
});
我正在尝试使用 fx.morph 显示我的导航,代码如下:
var fx = new Fx.Morph(_element, {
duration: 1000,transition:Fx.Transitions.Sine.easeOut
});
fx.start({
'height': [0, 100]
});
}
效果很好,我需要的是将高度从 0 设置为自动,而不是将 0 设置为 100.is 有什么解决方案吗?我尝试了自动和 100%,但没有用.
我已经做到了myself.I只需添加一个容器,然后计算该容器的高度并将其作为高度。
var _element = el.getElement('.child_first_nav_mobile');
if (_element) {
var fx = new Fx.Morph(_element, { duration: 1000 });
var autoheightdiv = _element;
autoheightdiv.style.height='auto';
var calcheight=autoheightdiv.offsetHeight
fx.start({
'height': [0, calcheight]
});