本文介绍了如何在nivo滑块中设置不同的效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的网站上有一个nivo滑块,但除了slideUp之外没有任何效果,即使我已经设置了默认安装。
I've got a nivo-slider on my site, but there aren't any effects except slidesUp, even though I have set the default installation.
<div class="slider-wrapper theme-default">
<div class="ribbon"></div>
<div id="slider" class="nivoSlider">
<img src="/upload/banners/image1.png" border="0" alt=""/>
<img src="/upload/banners/image2.png" border="0" alt=""/>
<img src="/upload/banners/image3.png" border="0" alt=""/>
</div>
</div>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
并在标题中:
<script type="text/javascript" src="/scripts/jquery.js"></script>
<script type="text/javascript" src="/scripts/jquery.nivo.slider.pack.js"></script>
<link rel="stylesheet" type="text/css" href="/css/nivo-slider.css"/>
我该怎么做才能让它正常工作?
What should I do to make it works properly?
推荐答案
zeusakm。
检查您的代码并查找:
zeusakm.Check your code and look for this:
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
您必须调用'效果'选项然后才能设置它。怎么样?:
You have to call the 'effect' option and then you can set it. How?:
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect:'random'
});
});
</script>
效果参数可以是以下任何一种:
The effect parameter can be any of the following:
- sliceDown
- sliceDownLeft
- sliceUp
- sliceUpLeft
- sliceUpDown
- sliceUpDownLeft
- fold
- fade
- random
- slideInRight
- slideInLeft
- boxRandom
- boxRain
- boxRainReverse
- boxRainGrow
- boxRainGrowReverse
- sliceDown
- sliceDownLeft
- sliceUp
- sliceUpLeft
- sliceUpDown
- sliceUpDownLeft
- fold
- fade
- random
- slideInRight
- slideInLeft
- boxRandom
- boxRain
- boxRainReverse
- boxRainGrow
- boxRainGrowReverse
完整参考:
这篇关于如何在nivo滑块中设置不同的效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!