请让我知道如何为以下JavaScript编写Jquery noConflict?有人建议我这个语法吗?
function openSearch() {
$("#myOverlay").fadeIn(); // "500" is not required. "400" is the default value
}
function closeSearch() {
$("#myOverlay").fadeOut(); // "500" is not required. ""400 is the default value
}
答案 0 :(得分:0)
使用未命名的函数包装器将jQuery作为参数传递。
jQuery.noConflict();
(function($){
$("#myOverlay").fadeIn(); // "500" is not required. "400" is the default
$("#myOverlay").fadeOut(); // "500" is not required. ""400 is the default
})(jQuery)