jQuery mobile data-transition
In jQuery mobile, page transition effect is accomplished by setting data-transition properties i.e slideup slidedown, etc.
Is there a way to call the effect using JavaScript?
Where is the complete API located开发者_开发技巧 at?
Thanks a lot in advance.
Try this:
// 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>
Look here for more examples and transitions
Edit Here are some APIs:
- http://jquerymobile.com/demos/1.0a4.1/
- http://brooky.cc/2011/04/23/jquery-mobile-cheat-sheet/
- http://jquerymobiledictionary.dyndns.org/
精彩评论