Flexslider navigation position

送分小仙女□ 提交于 2020-01-03 06:28:31

问题


Is there any option how to get flexslider navigation (it is directionNav: true) to specific <div> ? Now, there is no option how to control, where the navigation appears. It appears always inside

<div class="flexslider">

I want to make it outside the

<div class="flexslider">

回答1:


There is no such option in the plugin. But there is way for what you are trying to achieve. Using css/javascript set the display:none of .flex-prev and .flex-next . Now add your custom navigation handler wherever you want. Let's say you have .next and .prev as your custom handlers. now using jquery/javascript you can bind click events to them which in turn will trigger click events to the actual .flex-prev and .flex-next to accomplish what you want to do. Your jsfiddle doesn't work, it would have been better if there was a working jsfiddle from your side.

Demo: http://jsfiddle.net/lotusgodkk/GCu2D/85/

Javascript:

$('.flexslider').flexslider({
    animation: "slide"
});
$(document).on('click','.next',function(){
    $('.flex-direction-nav .flex-next:first').trigger('click');
    return false;
});
$(document).on('click','.prev',function(){
    $('.flex-direction-nav .flex-prev:first').trigger('click');
    return false;
});


来源:https://stackoverflow.com/questions/23513410/flexslider-navigation-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!