javascript - 试图弄清楚如何安装这个 jquery 脚本
问题描述
我正在尝试在此处安装此脚本:https ://www.jqueryscript.net/slider/Basic-Content-Carousel-Slider-Plugin-With-jQuery-gaBasicSlider.html
我对 jquery 了解不多,但是,我尽量按照说明进行操作。
在他们所说的使用以下代码初始化插件的说明的第 3 步:
$(document).ready(function(){
$('#example').gaBasicSlider();
});
并且这些设置可供使用:
// enable auto rotation
animate: true,
// animation delay time
animationDelay: 6000,
// animation duration time
animationTime: 300,
// CSS selector for custom indicator
indicators: null,
// CSS selector for custom next button
btnNext: null,
// CSS selector for custom previous button
btnPrevious: null
所以我的问题是,我如何使用上面的设置?我尝试做这样的事情,但是设置似乎没有生效。我做错了吗?见下文:
$(document).ready(function(){
$('#example').gaBasicSlider();
animationDelay: 2000,
animationTime: 100,
});
我是否在正确的地方使用了设置?或者它应该是一个单独的功能还是什么?
解决方案
像这样:
$('#example').gaBasicSlider({
btnNext : $('#example-next'),
btnPrevious : $('#example-previous'),
indicators : $('#example-indicators'),
animate: false
});
推荐阅读
- android - 下图
- ios - 如何移动逻辑以显示 UITableViewRowAction 从委托方法到视图模型(MVVM 架构)
- makefile - 如果使用 arm-poky-linux-gnueabi-gcc 在不同文件夹中构建相同的代码,则生成的二进制文件将具有不同的内容
- android - 如何不将下载的 mp3 文件显示到画廊?
- ruby-on-rails - 如何将特定控制器操作日志从 production.log 移动到 test.log ?红宝石 1.8.7 轨道 2.3
- reactjs - Okta 与 React JS
- java - 无法从 Firebase 访问嵌套数据
- caffe - 检查失败:status == cublas_status_success (1 vs. 0) cublas_status_not_initialized
- android - Firebase:获取 getReferenceFromUrl()
- dart - flutter:按钮onpress动作函数连续调用