为什么使用插件实现不了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>走马灯</title>
<link rel="stylesheet" type="text/css" href="./slick/slick.css">
<link rel="stylesheet" type="text/css" href="./slick/slick-theme.css">
</head>
<body>
<div class="your-class">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>
<script src="./slick/slick.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.your-class').slick({
lazyLoad: 'ondemand',
slidesToShow: 3,
slidesToScroll: 1})
});
</script>
</body>
</html>
使用插件没有左右的箭头没有办法切换啊
正在回答 回答被采纳积分+1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/slick-carousel/1.7.1/slick.css">
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/slick-carousel/1.7.1/slick-theme.min.css">
</head>
<body>
<div class="your-class">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js" type="text/javascript"></script>
<!-- slick走马灯 -->
<script src="https://cdn.bootcss.com/slick-carousel/1.7.1/slick.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
//slick走马灯
$('.your-class').slick({
autoplay:true,
accessibility:true,
autoplaySpeed:2000,
draggable:true,
speed: 500,
dots:true,
pauseOnHover:true,
arrows:true,
lazyLoad: 'ondemand',
infinite:true,
useCSS:true,
vertical:false,
slidesToShow: 4,
})
})
</script>
</body>
</html>
<link rel="stylesheet" type="text/css" href="./slick/slick.css"> <link rel="stylesheet" type="text/css" href="./slick/slick-theme.css">
<script src="./slick/slick.min.js" type="text/javascript" charset="utf-8"></script>
建议亲检查一下这三个路径是否正确,另外建议使用全拼式cdn的方式引入文件(即带有https://譬如<script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>)祝学习愉快!
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星