如何根据上一个或下一个幻灯片按键来更改Nivo Slider中的效果? [英] How can you change effect in Nivo Slider based off of previous or next slide keypress?
问题描述
我想基于按下哪个按钮来更改Nivo Slider上的过渡效果.关于如何实现此目标的任何想法?
I want to change the transition effect on Nivo Slider based off of which button was pressed. Any ideas of how to accomplish this?
更新 为了澄清,我指的是下一个或上一个按钮,而不是键盘上的按钮.我正在寻找的是如果有人按下下一个按钮,则会调用slideToRight过渡效果.如果有人按下上一个按钮,则会调用slideToLeft过渡效果.如果有人按了特定的滑片,并且滑向正确的方向,那么锦上添花.我喜欢Nivo Slider,但我觉得这些应该是默认的可选择操作.
Update To clarify, I meant the next or prev button, not a button on the keyboard. What I'm looking for is if a person presses the next button, a slideToRight transition effect is called. If a person presses the previous button, a slideToLeft transition effect is called. Then icing on the cake would be if someone presses a specific slide, if it slides the correct direction. I love Nivo Slider, but I feel like these should be default choosable actions.
推荐答案
$('.nivo-prevNav').live('mouseover', function(){
$('#slider img').attr("data-transition","sliceUpDown");
});
$('.nivo-nextNav').live('mouseover', function(){
$('#slider img').attr("data-transition","sliceUpDownLeft");
});
这篇关于如何根据上一个或下一个幻灯片按键来更改Nivo Slider中的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!