javascript 如何更改 Nivo-Slider 缓动?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6436159/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change Nivo-Slider easing?
提问by woninana
I'm using NivoSlider and I'm not really good on using javascript so I was wondering if how can I change the transition effects on nivo-slider? or can I change it? If it is possible, I would like to use only one transition effects on my images. Please help.
我正在使用 NivoSlider,但我不太擅长使用 javascript,所以我想知道如何更改 nivo-slider 的过渡效果?或者我可以改变它吗?如果可能,我只想在我的图像上使用一种过渡效果。请帮忙。
回答by Fidi
// This is the default setting:
$('#slider').nivoSlider({effect:'random'}) // Each transition effect will be random
// You can choose from the following effects:
// 您可以选择以下效果:
- sliceDown
- sliceDownLeft
- sliceUp
- sliceUpLeft
- sliceUpDown
- sliceUpDownLeft
- fold
- fade
- random
- slideInRight
- slideInLeft
- boxRandom
- boxRain
- boxRainReverse
- boxRainGrow
- boxRainGrowReverse
- 向下切片
- 左切片
- 切片
- 左切片
- 向上切片
- 切片上下左
- 折叠
- 褪色
- 随机的
- 向右滑动
- 向左滑动
- 盒子随机
- 盒子雨
- boxRainReverse
- boxRainGrow
- boxRainGrowReverse
回答by kinakuta
There are a number of "effects" the Nivo slider supports for transitions - have you seen the usage pageyet? You pass an object literal to the nivoSlider call with the parameters you want to use, effect being one of them you can specify. A list of how all the parameters you can set are shown and immediately following that is a list of the available effects. You'll have to be more specific about what specific effect you want if you want a more specific answer.
Nivo 滑块支持多种“效果”进行过渡——您看过使用页面了吗?您将一个对象文字传递给 nivoSlider 调用,其中包含您想要使用的参数, effect 是您可以指定的参数之一。您可以设置的所有参数的显示方式列表,紧随其后的是可用效果列表。如果您想要更具体的答案,则必须更具体地说明您想要的具体效果。
回答by Vivek
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({effect:"fade"});
});
</script>
Use other effects as per your need in place of "fade"
根据需要使用其他效果代替“淡入淡出”