View Full Version : Suggestion on Element.autoHeight()
Jack,
Love EXT, I just have a small suggestion on autoHeight()...
autoHeight:function( _animate_ ) {
this.clip();
this.setHeight(1);
var height=parseInt(this.dom.scrollHeight,10);
this.setHeight(height, _animate_ );
this.unclip();
}
Thanks -Zack
jack.slocum
4 Nov 2006, 12:31 PM
Great idea! I will put all the animation vars on it. I will also restore it to it's previous height before starting the animation so it looks right.
jack.slocum
4 Nov 2006, 12:40 PM
Here's a patch that adds it in:
YAHOO.ext.Element.prototype.autoHeight = function(animate, duration, onComplete, easing){
var oldHeight = this.getHeight();
this.clip();
this.setHeight(1); // force clipping
var height = parseInt(this.dom.scrollHeight, 10); // parseInt for Safari
if(!animate){
this.setHeight(height);
this.unclip();
}else{
this.setHeight(oldHeight); // restore original height
this.setHeight(height, animate, duration, function(){
this.unclip();
if(typeof onComplete == 'function') onComplete();
}.createDelegate(this), easing);
}
};
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.