问题描述
我已经使用 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:
弹性滑块:
<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.
就是这样.完美运行!
这篇关于Flexslider 手动控制不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!