How can you change effect in Nivo Slider based off of previous or next slide keypress?

前端 未结 3 1519
星月不相逢
星月不相逢 2021-01-07 13:10

I want to change the transition effect on Nivo Slider based off of which button was pressed. Any ideas of how to accomplish this?

Update To clarify

3条回答
  •  别那么骄傲
    2021-01-07 13:37

    Add this to "jquery.nivo.slider.js" before comment "// Run effects" after comment and code in "// Custom transition as defined by "data-transition" attribute". This show change current effect if you click on left or right arrow or buttons. For this work you must have imageis in HTML without "data-transition" attribute and default effect you must define in "jquery.nivo.slider.js" under comment "//Default settings" because "data-transition" attribute is prefer. I code it right know for my project.

            if(nudge === 'prev'){
                currentEffect = 'slideInLeft';
            } 
            else if (nudge === 'next'){
                currentEffect = 'slideInRight';
            }
            else if (nudge === 'control'){
                currentEffect = 'fade'; /*test*/
            }
    

提交回复
热议问题