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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -