javascript - tween back to auto-height with xuijs -


i'm having problems create equivalent slidedown xuijs.

the slideup (hide) done with

x$('elm').tween({height:'0'}); 

but there seem no way revert original height using tween.

$x('elm').setstyle('height','auto !important'); 

works fine no animation of course,

x$('elm').tween({height:'auto !important'}); 

does not work. (setting height fixed value however, that's not option).

kind of stuck here, document.getelementbyid('target_box').clientheight doesn't either once height set 0 tween or setstyle. solution can think of storing heights in array before initial global collapse of divs.

thankful help.

(the divs affected uses overflow: hidden)

regards,

//t

if you're using html5 why not store height data- attribute before call tween?

x$.extend({  'slideup' : function(){     = this[0];     x$(this).attr('data-h',this.clientheight);     x$(this).tween({height:'0'});  },  'slidedown' : function(){         = this[0];         x$(this).tween({height:x$(this).attr('data-h');});        } }); 

this code untested, it's worth shot.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -