if (this.div.className.match(/\bcollapsed\b/)) {
this.collapsed = true;
var region = YAHOO.util.Region.getRegion(this.caption);
- this.div.style.height = (region.bottom - region.top) + 'px';
+ this.div.style.height = (region.bottom - region.top + 3) + 'px';
}
// Add the appropriate image.
this.animation.stop();
}
if (this.collapsed) {
- var targetel = this.caption;
+ var region = YAHOO.util.Region.getRegion(this.caption);
+ var targetheight = region.bottom - region.top + 3;
} else {
- var targetel = this.innerdiv;
+ var region = YAHOO.util.Region.getRegion(this.innerdiv);
+ var targetheight = region.bottom - region.top + 2;
this.div.className = this.div.className.replace(/\s*\bcollapsed\b\s*/, ' ');
}
- var region = YAHOO.util.Region.getRegion(targetel);
- this.animation.attributes.height = { to: region.bottom - region.top, unit: 'px' };
+ this.animation.attributes.height = { to: targetheight, unit: 'px' };
this.animation.animate();
// Set the appropriate icon.