我正在尝试使用光滑的旋转木马中心模式示例,但我无法运行它。我不确定我做错了什么..有人能告诉我如何让它发挥作用吗?1
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="slick/slick.css" />
</head>
<body>
<div class="center">
<div>your content 1</div>
<div>your content 2</div>
<div>your content 3</div>
<div>your content 4</div>
<div>your content 5</div>
<div>your content 6</div>
<div>your content 7</div>
<div>your content 8</div>
<div>your content 9</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="slick/slick.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.center').slick({
centerMode: true,
centerPadding: '60px',
slidesToShow: 3,
responsive: [
{
breakpoint: 768,
settings: {
arrows: false,
centerMode: true,
centerPadding: '40px',
slidesToShow: 3
}
},
{
breakpoint: 480,
settings: {
arrows: false,
centerMode: true,
centerPadding: '40px',
slidesToShow: 1
}
}
]
});
});
</script>
</body>
答案 0 :(得分:0)
你可能不包括光滑的js和css文件,而是使用CDN,其他所有东西看起来都很好。
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/jquery.slick/1.4.1/slick.css"/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.slick/1.4.1/slick.min.js"></script>