我正在使用jquery mobile和backbonejs.有点坚持使用支持转换属性的主干路由.任何建议都会很棒..
define(['jquery'], function ($) {
$(document).on("mobileinit", function () {
$.mobile.ajaxEnabled = false;
$.mobile.linkBindingEnabled = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
$.mobile.defaultPageTransition = "slide";
});
});
Run Code Online (Sandbox Code Playgroud)
但幻灯片过渡不起作用.
路由器的代码如下
define([
'jquery',
'underscore',
'backbone',
'backbone.subroute'], function($, _, Backbone) {
var AppRouter = Backbone.Router.extend({
routes: {
// general routes
'': 'defaultAction',
'login':'login',
'message':'message',
'menu': 'mainMenu',
// Default
'*actions': 'defaultAction'
}
});
var initialize = function() {
$('.back').live('click', function(event) {
event.preventDefault();
window.history.back();
return false;
});
var app_router = new AppRouter;
app_router.on('route:defaultAction', function(actions) { …Run Code Online (Sandbox Code Playgroud)