我有两个按钮。现在我想让vistor点击button2,当点击button1时,站点调用style2.css
。援引style.css
。默认显示style.css
有没有办法使用jquery更改css的链接路径。使用jquery load diffent css?
<link rel="stylesheet" href="http://www.example.com/themes/style.css" type="text/css"/>
如果点击按钮2,行更改为< link rel="stylesheet" href="http://www.example.com/themes/style2.css" type="text/css"/>
或其他方式获得的效果。谢谢
这将改变文档中每个链接标签的'href'。 – rahul 2011-06-03 07:55:15
是的。 @zhuanzhou,如果你有点困惑(我不认为你会这样),那么你需要添加一个id到你的链接标签,并使用它作为你的jQuery选择器,如果你有多个链接标签。 – squidbe 2011-06-03 07:59:04
你的方式很棒,但是如何将id仅添加到css链接标签? – zhuanzhou 2011-06-03 08:01:45