PDA

View Full Version : blindShow animation effect



electric_bit
25 Dec 2006, 9:50 PM
Hi...

i want to ask about blindShow,

i see at the document about how to use blindShow, but how to set the element that have
blindShow effect, to show with the original height???

blindShow(String anchor, [Number newSize], [Float duration], [Function easing])

i use this code below...


//this doesn't work :(
actor.blindShow("top",false,0.25,false);

//this doesn't work :(
actor.blindShow("top",0,0.25,false);

//this doesn't work :(
actor.blindShow("top",default,0.25,false);

//this doesn't work :(
actor.blindShow("top",0.25,false);

//this doesn't work :(
actor.blindShow("top");


:(

thanks for the clue ...
:)

jack.slocum
26 Dec 2006, 3:50 AM
If you use blindHide to hide, blindHide returns the original size (an object with width/height) so you can restore it. Other than that you could try using actor.dom.scrollHeight for the newSize.

electric_bit
26 Dec 2006, 4:16 AM
yes, i use blindHide to hide the element,
and i use blindShow to unhide the element..

can blindHide show the hidden element too ..?

:(

jack.slocum
26 Dec 2006, 4:25 AM
// returns size for later restore
var size = actor.blindHide(...);

// then later
actor.blindShow('t', size.height ....

You may also want to try actor.autoHeight(true... which basically does the same thing only it measures the available height first.

electric_bit
27 Dec 2006, 2:32 AM
i use this code,


var LayoutExample = function(){
var eventManager = YAHOO.ext.EventManager;
showAndHideModule = function (){
var el = getEl("content");
var actor = new YAHOO.ext.Actor("content");
//set original height of element
var height = actor.autoHeight();
//Debugging alert(height);
actor.startCapture(true);
if(!( el.isVisible())){
actor.blindShow("t",height,0.25,false);
}else{
actor.blindHide("t",0.25,false);
}
actor.play();
}
return {
init : function(){
eventManager.on('close', 'click', showAndHideModule,false,true);
eventManager.on('open', 'click', showAndHideModule,false,true);
}
};
}();
YAHOO.ext.EventManager.onDocumentReady(LayoutExample.init, LayoutExample, true);


I set height element with "var height = actor.autoHeight();", that you can see at the top
, the element can hide and unhide, but the animation not working smoothly...
i try to see the height value with "alert(height)", the result is "Object object" not the numeric of height.

is anything wrong with my code ?
thanks .... :)

jack.slocum
27 Dec 2006, 5:27 AM
autoHeight doesn't return the height. It actually resizes the element.