Ticket #5213 (closed defect: fixed)
[dojox][patch] wipeInToHeight Contribution
| Reported by: | guest | Owned by: | dante |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1 |
| Component: | Dojox | Version: | 1.0 |
| Severity: | minor | Keywords: | |
| Cc: | ole.ersoy@…, ptwobrussell@… |
Description
This script hacks dojo.fx.wipeIn so that it wipes in to the finalHeight instead of the scrollHeight. This would be used in the Accordion (I think the dojo Accordion currently does the animation manually...) for wiping in to the calculated height of each content panel.
It's possible to use dojo.animateProperty...but then the person has to check style.display...etc. to see whether the these are set appropriately.
dojo.fx.wipeInToHeight = function(/*Object*/ args){
// summary // Returns an animation that will expand the // node defined in 'args' object from it's current height to // the finalHeight given by the args object. // Note that the final height should not include // units and should be an integer. Thus a valid args object // would look something like this: // args = {node: dojo.byId(nodeID), finalHeight: 200} // Node must have no margin/border/padding. args.node = dojo.byId(args.node); var node = args.node, s = node.style; var finalHeight = args.finalHeight;
var anim = dojo.animateProperty(dojo.mixin({
properties: {
height: {
// wrapped in functions so we wait till the last second to query (in case value has changed) start: function(){
// start at current [computed] height, but use 1px rather than 0 // because 0 causes IE to display the whole panel s.overflow="hidden";
if(s.visibility=="hidden"
s.display=="none"){ s.height="1px"; s.display=""; s.visibility=""; return 1;
}else{
var height = dojo.style(node, "height"); return Math.max(height, 1);
}
}, end: finalHeight
}
}
}, args)); return anim; // dojo._Animation
}
Attachments
Change History
Note: See TracTickets for help on using tickets.Download in other formats: