我已經成功地將積分與離子積分相結合,但每次翻轉本本, 離子送我回$urlRouterProvider.otherwise('/login');
。積分與離子積分
這就像離子不承認狀態#/book
。
這裏是我的代碼: http://plnkr.co/edit/BKpXGfU64t69ITWiMtQh?p=preview
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.backButton.text('').previousTitleText('');
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "menu.html",
controller: 'AppCtrl'
})
.state('login', {
url: "/login",
templateUrl: "login.html"
})
.state('book', {
url: '/book',
templateUrl: "book.html",
controller: function($stateParams, $timeout) {
$timeout(function() {
$(document).ready(function() {
$('#features').wowBook({
height: 500,
width: 800,
centeredWhenClosed: true,
hardcovers: true,
turnPageDuration: 1000,
numberedPages: [1, -2],
controls: {
zoomIn: '#zoomin',
zoomOut: '#zoomout',
next: '#next',
back: '#back',
first: '#first',
last: '#last',
slideShow: '#slideshow',
flipSound: '#flipsound',
thumbnails: '#thumbs',
fullscreen: '#fullscreen'
},
scaleToFit: "#container",
thumbnailsPosition: 'bottom',
onFullscreenError: function() {
var msg = "Fullscreen failed.";
if (self != top) msg = "The frame is blocking full screen mode. Click on 'remove frame' button above and try to go full screen again."
alert(msg);
}
}).css({ 'display': 'none', 'margin': 'auto' }).fadeIn(1000);
$("#cover").click(function() {
$.wowBook("#features").advance();
});
var book = $.wowBook("#features");
function rebuildThumbnails() {
book.destroyThumbnails()
book.showThumbnails()
$("#thumbs_holder").css("marginTop", -$("#thumbs_holder").height()/2)
}
$("#thumbs_position button").on("click", function() {
var position = $(this).text().toLowerCase()
if ($(this).data("customized")) {
position = "top"
book.opts.thumbnailsParent = "#thumbs_holder";
} else {
book.opts.thumbnailsParent = "body";
}
book.opts.thumbnailsPosition = position
rebuildThumbnails();
})
$("#thumb_automatic").click(function() {
book.opts.thumbnailsSprite = null
book.opts.thumbnailWidth = null
rebuildThumbnails();
})
$("#thumb_sprite").click(function() {
book.opts.thumbnailsSprite = "images/thumbs.jpg"
book.opts.thumbnailWidth = 136
rebuildThumbnails();
})
$("#thumbs_size button").click(function() {
var factor = 0.02 * ($(this).index() ? -1 : 1);
book.opts.thumbnailScale = book.opts.thumbnailScale + factor;
rebuildThumbnails();
})
});
}, 0);
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/login');
});
是,翻轉頁面在1,3,5,7增量附加的URL, #/ book,#/ book/3等等。 $ stateparams.id可能增加1,3,5 – netx
讓我看看,一旦我得到了一些時間,直到那時你可以改變CSS來使它適合每個設備 沒有什麼是不可能的我的朋友 –