我只是想让一个简单的旋转木马工作,但页面只显示我没有任何旋转木马的图片。我该如何解决?我正在关注“使用入门”指南:http://kenwheeler.github.io/slick/
<html>
<head>
<title>My Now Amazing Webpage</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><img src="images/image1.png"></div>
<div><img src="images/image2.png"></div>
<div><img src="images/image3.png"></div>
<div><img src="images/image4.png"></div>
<div><img src="images/image5.png"></div>
<div><img src="images/image13.png"></div>
<div><img src="images/image6.png"></div>
<div><img src="images/image21.png"></div>
<div><img src="images/image3.png"></div>
<div><img src="images/image9.png"></div>
<div><img src="images/image12.png"></div>
<div><img src="images/image13.png"></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(){
$('.your-class').slick({
setting-name: setting-value
});
});
$('.variable-width').slick({
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
centerMode: true,
variableWidth: true
});
$('.autoplay').slick({
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
});
</script>
</body>
</html>
答案 0 :(得分:1)
您实际上并未初始化div
。 setting-name : setting-value
是伪代码,表示名称和值需要替换。
正确初始化的一个例子是:
$(document).ready(function(){
$('.your-class').slick({
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
centerMode: true,
variableWidth: true
});
});