我有一个使用 turn.js 的 Ionic v1 项目,但现在我使用的是 Ionic v2。我在使用 jQuery 导入 turn.js 时遇到问题。
angular.module('albumController', [])
.directive('flipbook', function () {
return {
restrict: 'E',
replace: true,
compile: function (element, attrs) {
element.turn({
width: '300px',
height: '300px',
pages: 8
}).turn('peel', 'br');
element.addClass('flipbook');
return function (scope, el) {
el.on('click', '[data-page]', function (e) {
el.turn('page', $(e.target).data('page'));
});
};
},
templateUrl: "flipbook.html"
}
});
谢谢!