我想加載一些jquery窗口加載但是我收到'jQuery未定義'的錯誤。jquery未定義wordpress窗口加載
這是我的jQuery。
jquery(function($) { //jQuery passed in as first param, so you can use $ inside
jquery(window).load(function ($) {
$('#newsPost').masonry({
columnWidth: '.col-lg-6',
itemSelector: '.item'
});
})
});
我已經在文檔準備好的情況下正常工作,但窗口加載未定義。
下面是該最終工作版本的更新:
jQuery(function($) {
$(window).load(function() {
$('#newsPost').masonry({
columnWidth: '.col-lg-6',
itemSelector: '.item'
});
})
});
因爲當你調用這個函數時jquery還沒有準備好? – moped