jQuery和MooTools相互冲突
我在jQuery中使用了下面的代码,这很有效jQuery和MooTools相互冲突,jquery,mootools,Jquery,Mootools,我在jQuery中使用了下面的代码,这很有效 $('.s_switcher').hover(function() { $(this).find('.s_options').stop(true, true).slideDown('fast'); },function() { $(this).find('.s_options').stop(true, true).slideUp('fast'); }); 在替换代码并添加MooTools和Jquery之后,没有结果,代码也不起作用 //
$('.s_switcher').hover(function() {
$(this).find('.s_options').stop(true, true).slideDown('fast');
},function() {
$(this).find('.s_options').stop(true, true).slideUp('fast');
});
在替换代码并添加MooTools和Jquery之后,没有结果,代码也不起作用
//no conflict jquery
jQuery.noConflict();
//jquery stuff
$jQuery('.s_switcher').hover(function() {
$jQuery(this).find('.s_options').stop(true, true).slideDown('fast');
},function() {
$jQuery(this).find('.s_options').stop(true, true).slideUp('fast');
})(jQuery);
如果有人能帮忙,请告诉我,谢谢你使用jQuery(…)
而不是$jQuery(…)
。或者您可以创建$jQuery
作为jQuery
的别名,如下所示:$jQuery=jQuery.noConflict()
另外,删除代码末尾的
(jQuery)
——它什么都不做