2011-07-06 77 views
0

在jQuery Mobile的,頁面過渡效果是通過設置數據轉換屬性進行即效果基本show了slideDown等jQuery Mobile的數據轉換

有沒有一種方法調用使用JavaScript的影響?

完整的API位於哪裏?

非常感謝。

回答

1

試試這個:

// Define your transition handler: 

function myTransitionHandler(name, reverse, $to, $from) 
{ 
    var deferred = new $.Deferred(); 

    // Perform any actions or set-up necessary to kick-off 
    // your transition here. The only requirement is that 
    // whenever the transition completes, your code calls 
    // deferred.resolve(name, reverse, $to, $from). 

    // Return a promise. 
    return deferred.promise(); 
} 

// Register it with jQuery Mobile: 

$.mobile.transitionHandlers["myTransition"] = myTransitionHandler; 

HTML:

<a href="#page2" data-transition="myTransition">Page 2</a> 

here for more examples and transitions

編輯這裏有一些API:

+0

非常感謝,檸檬胡椒 – iwan