我有一個Jssor滑塊,運行良好的jQuery版本。但是當我把代碼和JS文件放到我的AngularJS應用程序中時,它不起作用。我的控制檯出現以下錯誤:Jssor滑塊不適用於AngularJS
Uncaught TypeError: Cannot read property 'currentStyle' of undefined
在AngularJS中使用Jssor滑塊有什麼具體的方法嗎?
var app = angular.module('slider', []);
app.controller('sliderCtrl', function($scope){
this.slides = [
{heading: 'movies', number: 115, panel: 'panel-green'},
{heading: 'viewed', number: 252 , panel: 'panel-primary'},
{heading: 'streams', number: 354 , panel: 'panel-yellow'},
{heading: 'length', number: 471 , panel: 'panel-green'},
{heading: 'Spent', number: 589, panel: 'panel-red'},
{heading: 'viewed two', number: 789 ,panel: 'panel-yellow'},
{heading: 'streams two', number: 412 , panel: 'panel-green'},
{heading: 'length two', number: 456, panel: 'panel-red'}
];
$scope.data = this;
});
<div id="wrapper">
<div class="row" id="page-wrapper" ng-controller="sliderCtrl">
<div id="slider1_container">
<div u="slides" class="slides" class="col-lg-2 col-custom-lg-2 col-md-4">
<div ng-repeat="div in data.slides" class="panel {{div.panel}}">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
</div>
<div class="col-xs-12 text-right">
<div class="huge">{{div.number}}</div>
<div >{{div.heading}}</div>
</div>
</div>
</div>
</div>
</div>
<span u="arrowleft" class="jssora03l arrowleft"></span>
<span u="arrowright" class="jssora03r arrowright"></span>
</div>
</div>
我只是想上面的代碼,它工作在我的主HTML佈局。但是,當我將它放入我的模板中時,它不起作用,並且遇到同樣的錯誤。
你能分享一下代碼嗎? –
你忘了包含jssor.core.js和jssor.utils.js嗎? – Kushal
不,我同時包括js – bhushanRJ