有一些jquery冲突让我无法理解。我有一个单独的脚本在这里工作:
http://www.pitestiretailpark.ro/working.html
当将相同的脚本插入Joomla页面(以及html / css代码)时,下拉菜单不起作用。
http://www.pitestiretailpark.ro/test/
我不是程序员,我知道我的HTML,但对jquery知之甚少。独立脚本已从另一个页面复制,裸露(但工作!),当我尝试插入Joomla时,它停止工作。
答案 0 :(得分:3)
还有另一个使用$
符号作为函数的lib。使用这样的jQuery.noConflict()方法;
jQuery.noConflict();
jQuery( document ).ready(function( $ ) {
// your code
});
答案 1 :(得分:1)
使用jQuery替换脚本中的$,并在文档就绪时调用它:
jQuery(document).ready(function() {
jQuery('.div_btn_menu').hover(
function() {
jQuery(this).children('.div_sous-menu').css('top',$(this).children('.btn_menu').height()+'px')
jQuery(this).css('z-index',10000000)
jQuery(this).children('.div_sous-menu').stop(true,true).fadeIn(200)
},
function() {
jQuery(this).css('z-index',1)
jQuery(this).children('.div_sous-menu').stop(true,true).fadeOut(200)
}
);
})