var $ = jQuery.noConflict();
$(document).ready(function() {
if ((screen.width>=1024)) {
$('link[title=theme800]')[0].disabled=true;
$('link[title=theme]')[0].disabled=false;
}
if ((screen.width<1024)) {
$('link[title=theme]')[0].disabled=true;
$('link[title=theme800]')[0].disabled=false;
}
});
不工作我的HTML页面:调整屏幕大小后启用样式表?在IE和Chrome
<link title = "theme" rel="stylesheet" type="text/css" media="all" href="theme.css" />
<link title = "theme800" rel="stylesheet" type="text/css" media="all" href="theme800.css" />
好吧,我在不同的屏幕尺寸测试我的网站。出于某种原因,当我处于'< 1024'模式时,第二个样式表(theme800)未在IE和Chrome中加载,它与Firefox tho一起使用。 我确实给了一切标题和一切。同样,它可以在Firefox中运行,但在其他浏览器中不起作用。我如何让它在其他浏览器中工作? 帮助!
谢谢。
尝试切换链接元素的href。 – AgnosticDev
你的代码中没有任何东西可以阻止从加载链接....更有可能你有相同的CSS选择器和最后一个加载优势。事实上,你的代码不会做任何事情 – charlietfl
我尝试将其切换到href,仍然无法正常工作。 – Yoosuf