开发者

How do I unset CSS values?

开发者 https://www.devze.com 2023-03-04 22:41 出处:网络
I have written a Firefox extension which alters the look and feel of Facebook. For this I used JS code to inject CSS styles to override FB defined values. But for some url patterns I don\'t 开发者_JAV

I have written a Firefox extension which alters the look and feel of Facebook. For this I used JS code to inject CSS styles to override FB defined values. But for some url patterns I don't 开发者_JAVA百科want to force my styles. The issue here is the FB doesn't seem to load the full page but parts of page (but somehow the url in address changes).

This means when the new page loads my old styles will still remain applied and I want to restore them to their original values. How should I do that?


You should inject all your custom CSS styles into one <style> element, and then remove this <style> element (using JavaScript) when a new page is loaded on which you don't want your custom CSS.

Here's an example using jQuery: http://jsfiddle.net/thirtydot/BAPZF/

0

精彩评论

暂无评论...
验证码 换一张
取 消