简体   繁体   English

JS FlexSlider在Joomla 3中不起作用

[英]JS FlexSlider doesn't work in Joomla 3

I have a JS FlexSlider module in my joomla page. 我的joomla页面中有一个JS FlexSlider模块。 It works fine on all positions but not at the Position I want it to be. 它适用于所有职位,但不适用于我想要的职位。

And the position works fine with all other modules. 并且该位置在所有其他模块上都可以正常工作。

Here is the page: http://www.ehemalige-hoelderlingym.de 这是网页: http//www.ehemalige-hoelderlingym.de

If you check your browser console, you will see a JS error. 如果检查浏览器控制台,则会看到JS错误。 You also have 2 jQuery libraries being imported which simply means that the developer of FlexSlider has not stuck to Joomla coding standards. 您还导入了2个jQuery库,这仅表示FlexSlider的开发人员尚未遵循Joomla编码标准。

In the Module Parameters, you will see the option Enable jQuery 1.8.2? 在模块参数中,您将看到选项启用jQuery 1.8.2? which you need to set to No . 您需要将其设置为No。

This will prevent duplicate jQuery libraries being imported and thus most likely fix the console error. 这将防止导入重复的jQuery库,因此很可能会修复控制台错误。

They should really remove this option for the Joomla 3.x version of JS FlexSlider as it is simply not required. 他们确实应该为JS FlexSlider的Joomla 3.x版本删除此选项,因为它根本不是必需的。

Update: 更新:

I've checked Firebug and you're now getting an error because the module is importing the script before jQuery. 我检查了Firebug,现在遇到错误,因为该模块在jQuery之前导入脚本。

You have 3 options: 您有3种选择:

Option 1: Download and install the jQuery Easy plugin. 选项1:下载并安装jQuery Easy插件。 This will ensure jQuery is loaded only once and before any other script on your site. 这样可以确保只加载一次jQuery,然后再加载您网站上的其他任何脚本。

Option 2: Create a Template Override for the module and once done, in the default.php change this: 选项2:为模块创建模板替代 ,并在完成后在default.php中更改此设置:

<script src="modules/mod_js_flexslider/assets/js/jquery.flexslider-min.js" type="text/javascript"></script>

to this: 对此:

<?php JHtml::_('script', JUri::root() . 'modules/mod_js_flexslider/assets/js/jquery.flexslider-min.js'); ?>

Option 3: Use a different slider extension 选项3:使用其他滑块扩展


Personally I would go with option 3 as you shouldn't have to rely on a 3rd party plugin to get a slider working, and option 2 is something the developer should do. 就个人而言,我会选择选项3,因为您不必依靠第三方插件来使滑块正常工作,而选项2是开发人员应该做的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM