为什么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