当我们知道如何在网页中检测iPhone/iPod/iPad等浏览设备时,就能够实施调用不同的CSS了,示例代码:

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
document.write('<link href="iphone.css" rel="stylesheet" type="text/css">');
}
if((navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/iPod/i))) {
document.write('<link href="ipadwoflash.css" rel="stylesheet" type="text/css">');
}



相关文章: