0
我有jQuery的功能是這樣的:。對()的.fn jQuery函數不工作
(function($){
$.fn.LazyImageLoad = function() {
$(this).on('scroll load resize' , function() {
console.log ('Lazy Image Load run')
$('img' , this).each(function() {
$(this).hide(1000) ;
});
});
}
})(jQuery);
,並設置我的元素在這個溫控功能,例如
$(document).ready(function() {
$(window).LazyImageLoad();
$('body').LazyImageLoad();
$('.Container_C2').LazyImageLoad();
});
但$(this).on()
上.fn jquery function
不行 和console.log
和$(img).show() for each
img不運行,
那麼你會建議我做什麼?
其中下面的代碼:'$(IMG).show()'。你是否錯過了一些代碼? – vijayP
由於您綁定了某些未由某些元素處理的事件,因此請描述不起作用。而FYI,'this'已經是原型jq.fn方法中的jQuery對象 –