爲什麼iPad上的ready/resize事件不起作用?他們在電腦上工作,但不在iPad上工作。有人知道我做錯了什麼嗎?jQuery .ready/resize在iPad上不起作用
jQuery(document).on('ready', function() {
jQuery(window).on('resize', function() {
/* Tablet Portrait size to standard 960 (devices and browsers) */
if (jQuery(window).width() < 960 && jQuery(window).width() > 768) {
//change the attributes from the div #home_content (first parameter: the attribute, what it needs to be)
jQuery('#home_content').attr('class','sixteen columns');
jQuery('#slider').attr('class','sixteen columns');
}
else{
jQuery('#home_content').attr('class','nine columns');
jQuery('#slider').attr('class','nine columns');
}
/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
if(jQuery(window).width() < 767 && jQuery(window).width() > 480) {
//code
}
else{
}
/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
if(jQuery(window).width() < 479) {
//code
}
else{
}
}).trigger('resize'); // Trigger resize handlers.
});//ready
你的意思是他們沒有工作,或沒有解僱?如果你把'alert('foo')'放在那裏,它會彈出嗎? – beeglebug
在計算機上彈出,但不在iPad上 – Brampage
您是否已將該提醒放入文檔或準備調整大小?他們兩個都不是射擊還是隻有一個? – beeglebug