过渡动画用js方法怎么写,怎么拿到需要的元素
transitions:{ ‘expand’:{ enter:function(el,done){ var childHeight = $($(el)[0].children[0]).css(‘height’).replace(‘px’,’’) - 0; var height = $(el)[0].children.length * childHeight + “px”; $(el) .css({‘height’:‘0px’,‘overflow’:‘hidden’,‘opacity’:‘0’}) .animate({‘height’:height,‘opacity’:‘1’},200,function(){ }); }, leave:function(el,done){ var childHeight = $($(el)[0].children[0]).css(‘height’).replace(‘px’,’’) - 0; var height = $(el)[0].children.length * childHeight + “px”; $(el) .css({‘height’:height,‘overflow’:‘hidden’,‘opacity’:‘1’}) .animate({‘height’:‘0px’,‘opacity’:‘0’},200,function(){ }); } } }