javascript - Auto Swap External CSS Stylesheet with toggle scripting -


Hi, I am trying to toggle back this script back to the original CSS external stylesheet.

I have the following code that works.

  $ (document) .ready (function () {$ ("# css-master2"). Click (function () {$ ("link [title = change]"). Attr ({href: "css / master2.css"});});});  

Whenever someone clicks anything with id # css-master2, it changes master2.css to an external style sheet (that part works fine).

What I want is that it changes back to the original master1.css, if she clicks it again something like toggle?

Any help would be greatly appreciated.

Check for the link's href, if it is equal to master 2, Switch back to 1.

Why can not you do this, can not think that the right thing can be done through two different files instead of CSS classes.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -