2014-01-11 46 views
1

我在jQuery Mobile的1.4.0有一个可折叠的一套我想添加自定义动画,这可压缩集扩张时像animation here添加自定义动画可折叠集jQuery Mobile的

my collapsible set at JSFiddle

我已经使用了以下样式来制作可折叠的动画,但它没有给出相同的结果。如何在展开后将此滑动向下/向上的动画应用到我的可折叠的动画中?

请帮助我..

.ui-collapsible-content { 
    -webkit-transition: all 1s; 
    -moz-transition: all 1s; 
    -ms-transition: all 1s; 
    -o-transition: all 1s; 
    transition: all 1s; 
    height: 2em; 
    overflow: hidden; 
} 

.ui-collapsible-content-collapsed { 
    display: block; 
    height: 0; 
    padding: 0 16px; 
} 

回答

11

这里是我的代码

$("[data-role='collapsible']").collapsible({ 

    collapse: function(event, ui) { 
     $(this).children().next().slideUp(150); 
    }, 
    expand: function(event, ui) { 
     $(this).children().next().hide(); 
     $(this).children().next().slideDown(150); 
    } 

}); 

此代码使用jQuery移动1.4.0进行测试。 谢谢。