Flexslider 手动控制不起作用

编程入门 行业动态 更新时间:2024-10-28 04:29:34
本文介绍了Flexslider 手动控制不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用 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 手动控制不起作用

本文发布于:2023-07-10 08:34:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1089857.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   Flexslider

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!