我正在尝试在我的一个视图中设置这个:http://kenwheeler.github.io/slick/
无论我在哪里放置以下代码:
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.5.9/slick.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
console.log("slicking");
$('.butikk').slick({});
});
</script>
它不会激活浮油。
我在主视图主体中尝试,在主体的末尾,我在.butikk
所在的视图中尝试。
如何让Slick工作?
我不知道它是否能在angularjs环境下工作
如果我在控制台中尝试滑动器:
Uncaught TypeError: $(…)。Slick不是一个函数(…)
但是我相信错误正在发生,因为它没有正确加载,不要在代码的其他地方得到错误,只有当我从控制台日志调用它。
EDIT1:
尝试这个http://vasyabigi.github.io/angular-slick/我有一个沉重的负载到我的网站。加载不了。angular花的时间太长了
我也得到了这个安装:
Unable to find a suitable version for angular, please choose one by typing one of the numbers below:
1) angular#~1.3.0 which resolved to 1.3.20 and is required by angular-slick#0.2.1
2) angular#1.5.5 which resolved to 1.5.5 and is required by angular-animate#1.5.5
3) angular#^1.0.8 which resolved to 1.5.8 and is required by angular-ui-router#0.2.18
4) angular#~1.5.0 which resolved to 1.5.8 and is required by meanjs
5) angular#>=1.4.0 which resolved to 1.5.8 and is required by angular-bootstrap#1.2.5
6) angular#^1.1.5 which resolved to 1.5.8 and is required by angular-file-upload#2.2.0
Prefix the choice with ! to persist it to bower.json
保尔文件: {
"name": "meanjs",
"description": "Fullstack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
"homepage": "http://meanjs.org/",
"license": "MIT",
"dependencies": {
"angular": "~1.5.0",
"angular-animate": "~1.5.0",
"angular-bootstrap": "~1.2.1",
"angular-file-upload": "~2.2.0",
"angular-messages": "~1.5.0",
"angular-mocks": "~1.5.0",
"angular-resource": "~1.5.0",
"angular-ui-router": "~0.2.18",
"bootstrap": "~3.3.6",
"owasp-password-strength-test": "~1.3.0",
"angular-slick": "~0.2.1"
},
"resolutions" : {
"angular" : "1.3.15",
}
"overrides": {
"bootstrap": {
"main": [
"dist/css/bootstrap.css",
"dist/css/bootstrap-theme.css",
"less/bootstrap.less"
]
},
"jquery": {
"main": []
}
}
}
edit 2:
尝试bower update
然后我得到了这个:
Unable to find a suitable version for angular, please choose one by typing one of the numbers below:
1) angular#~1.3.0 which resolved to 1.3.20 and is required by angular-slick#0.2.1
2) angular#1.5.8 which resolved to 1.5.8 and is required by angular-animate#1.5.8, angular-messages#1.5.8, angular-mocks#1.5.8, angular-resource#1.5.8
3) angular#>=1.4.0 which resolved to 1.5.8 and is required by angular-bootstrap#1.2.5
4) angular#~1.5.0 which resolved to 1.5.8 and is required by meanjs
5) angular#^1.1.5 which resolved to 1.5.8 and is required by angular-file-upload#2.2.0
6) angular#^1.0.8 which resolved to 1.5.8 and is required by angular-ui-router#0.2.18
Prefix the choice with ! to persist it to bower.json
在github上搜索光滑库的问题,我找到了这个angular-slick库。使用起来似乎很简单,试试