我正在尝试将带有 id的内容包含NivoSlider
到我的页面中。我已经尝试按照他们网站上的教程进行操作,但现在四天没有效果。请检查一下 :div
imageslider
索引.php
<!-- In the head section I have included these -->
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script src="jquery.nivo.slider.pack.js" type="text/javascript"></script>
<!-- Somewhere in the body section -->
<div id="imageslider">
<div class="slider-wrapper">
<div id="slider" class="nivoSlider">
<img src="abc.jpeg" alt="" height="360" width="700"/>
<img src="uvw.jpeg" alt="" height="360" width="700"/>
<img src="pqr.jpeg" alt="" height="360" width="700"/>
<img src="xyz.jpeg" alt="" height="360" width="700"/>
</div>
</div>
</div>
<!-- Also at the end of the body tag-->
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
在我的样式表中,style.css
#imageslider {
float: right;
width: 700px;
background-color: blue;
height: 360px;
margin-left: 5px;
margin-right: 15px;
}
/*Rest styles are copied from the website itself*/
.nivoSlider {
position:relative;
background:url(images/loading.gif) no-repeat 50% 50%;
}
.nivoSlider img {
position:absolute;
top:0px;
left:0px;
display:none;
}
.nivoSlider a {
border:0;
display:block;
}
当我打开或刷新页面时,imageslider
div 中没有出现图像。请帮帮我!