2014-01-11 47 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進行測試。 謝謝。