0
我在$(window).resize中無法在Internet Explorer中工作時出現問題。我現在只在IE 8中檢查過。
基本上,我已經創建了一個函數,我們稱之爲calculate()。該函數根據窗口的當前寬度更改某些元素的寬度/高度。因此,該功能需要在準備好的文檔和瀏覽器的每個調整大小上調用。但是,當我調用函數窗口調整它不在IE中工作!但更奇怪的是,它在文檔準備就緒上完全正常工作,而不是在窗口大小調整上。
下面是代碼:
jQuery.noConflict();
jQuery(document).ready(function($){
calculations(); // works fine here, it does all what it should do
$(window).resize(function(){
calculations(); // works fine in all browsers except IE
})
function calculations() {
//definition of function calculations here (i haven't pasted the exact function, all it does is change some widths and heights)
}
});
jquery.noConflict $重新分配,因此現在你的$不再提及jQuery的。 – Baz1nga
'$'來自回調「就緒」功能,並且當前每個列出的代碼都是正確的。 – harningt