问题
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