简体   繁体   English

Joomla 3.2模块中的jQuery插件无法加载/工作

[英]jQuery plugin in Joomla 3.2 module doesn't load/work

I'm having problems with a piece of JavaScript on my Joomla page. 我的Joomla页面上的JavaScript出现问题。 Please bear with me, because I'm far from an expert. 请忍受我,因为我远非专家。

I'm using a regular (so not an actual Joomla plugin) plugin to show my portfolio. 我使用的是常规(而不是实际的Joomla插件)​​插件来显示我的作品集。 This is how it should be working: http://portfolio.heshley.nl/templates/j ... black.html 它应该是这样工作的: http : //portfolio.heshley.nl/templates/j ... black.html

This is how it should NOT be working: http://portfolio.heshley.nl/ 这是它不应起作用的方式: http : //portfolio.heshley.nl/

So, I did and tried a lot. 因此,我做了很多尝试。

  • I added the JavaScript library and put it way on top in the head 我添加了JavaScript库,并将其放在顶部
  • I put the code in a module and changed every $ to jQuery 我将代码放在模块中,并将每个$更改为jQuery
  • I put the code in my index.php and also changed every $ to jQuery 我将代码放在index.php中,还将每个$都更改为jQuery
  • Used PHP in my index.php to load the external colio file index in a module 在index.php中使用PHP将模块中的外部colio文件索引加载到模块中
  • Disabled mootools deleted double loaded scripts 禁用的mootools删除了双重加载的脚本
  • I went back to jQuery 1.10.2 as used by the colio plugin 我回到了colio插件使用的jQuery 1.10.2
  • Changed all the links to absolute links 将所有链接更改为绝对链接
  • I found a tons of optional solutions while googling and I tried every one of them. 谷歌搜索时发现了大量的可选解决方案,我尝试了其中的每一个。 I don't remember most of them though. 我不记得大多数人。

I'm really lost here and the developer of the plugin didn't find a solution either. 我真的在这里迷路了,插件的开发人员也没有找到解决方案。 Probably because he is not really into Joomla. 可能是因为他不太喜欢Joomla。

Does someone know what I can do? 有人知道我能做什么吗? As I mentioned above, I'm no expert, but I know the basics. 正如我上面提到的,我不是专家,但是我知道一些基础知识。 So if you have a step by step solution, that would be super! 因此,如果您有逐步的解决方案,那就太好了!

your first link is not working, so I dont really se what's not working in the second. 您的第一个链接不起作用,所以我真的不知道第二个链接不起作用。 But: If you look in the html-source, you are loading jquery twice, once at the top (probably in the index.php-file of the jsn_yoyo_pro - template) and once further down (probably loaded by Joomla somewhere?). 但是:如果您查看html源代码,则将两次加载jquery,一次是在顶部(可能在jsn_yoyo_pro的index.php文件中-模板),另一次是在更低的位置(可能是Joomla在某处加载了?)。 Try to move the includes in index.php below the 尝试将index.php中的包含移动到

<jdoc:include type="head" /> 

tag, so that Joomlas includes will come first. 标签,因此Joomlas包含的内容将排在第一位。 Then remove the includes you have that are loading the same library. 然后删除包含相同库的包含项。

Also, I see that both jquery and mootools are loading, so I quess jquery is in no-conflict mode. 另外,我看到jquery和mootools都在加载,所以我让jquery处于无冲突模式。 This means all jquery-calls hase to be made using: 这意味着必须使用以下命令进行所有jquery调用:

jQuery( ... )

instead of 代替

$( ... )

(Mind the case of jQuery() ). (请注意jQuery()的情况)。 So replace all references to $( with jQuery( 因此,将所有对$(的引用替换为jQuery(

regards Jonas 问候乔纳斯

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

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