Jssor滑块不适用于AngularJS
16lz
2021-01-22
I have a Jssor slider which is running fine with the jQuery version. But when I put the code and JS files into my AngularJS app, it is not working. I get the following error in my console:
我有一个Jssor滑块,它与jQuery版本运行良好。但是当我将代码和JS文件放入我的AngularJS应用程序时,它无法正常工作。我在控制台中收到以下错误:
Uncaught TypeError: Cannot read property 'currentStyle' of undefined
未捕获的TypeError:无法读取未定义的属性“currentStyle”
Is there any specific way to work with Jssor slider in AngularJS?
在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>
更多相关文章
- Typeahead 0.10.2没有在Rails 4 / Bootstrap 3应用程序中显示建
- 在Rails应用程序中结合Scriptaculous和JQuery
- Web 应用程序学习笔记
- Wordpress网站上的亚马逊链接无法正确打开亚马逊应用程序
- 为什么我不用Javascript和Javascript HTML模板构建整个Web应用程
- 维护Java应用程序的多种形式的用户指南
- HTML5 的应用程序缓存和优势
- 如何在应用程序中嵌入图像并在HTML控件中使用它们?
- 通过SSH将MySQL绑定到本地端口——在控制台工作,而不是通过Mac OS