Flexslider手册控件不起作用 [英] Flexslider manualControls not working
问题描述
我已经用Flexslider创建了一个滑块,并且尝试使用manualControls:创建一个导航菜单,但是链接不起作用.这是flexslider和滑块/导航本身的代码:
I have created a slider with Flexslider and I am trying to use manualControls: to create a navigation menu but the links wont work. Here is code for flexslider and the slider/navigation itself:
Flexslider:
Flexslider:
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('.flexslider').flexslider({
controlsContainer: ".slidercontainer",
controlNav: true,
manualControls: ".flex-control-nav li",
});
});
</script>
滑块和导航:
<div class="slidercontainer">
<div class="flexslider">
<ul class="slides">
<li>slide1</li>
<li>slide2</li>
</ul>
<ul class="flex-control-nav">
<li>1</li>
<li>2</li>
</ul>
</div>
</div>
推荐答案
您是否已解决此问题?如果不是,答案是因为FlexSlider在插件中仍然有一个实时事件-但jQuery已弃用此方法.
have you fixed this yet? If not, the answer is because FlexSlider still has a live event in the plugin - but jQuery has deprecated this.
要修复它;打开jQuery.flexslider.js并查找/替换"live",将其替换为"on".我实际上搜索了".live(",并替换为".on(",以确保仅获得事件侦听器.有2次出现.
To fix it; open up jQuery.flexslider.js and do a find/replace for "live", replacing it with "on". I actually searched ".live(" and replaced with ".on(" just to make sure I only got the event listener. There are 2 occurrences.
就是这样.完美地工作!
That's it. Works perfectly!
这篇关于Flexslider手册控件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!