I am trying to add in a very simple method of switching between 2 stylesheets.
I can get the stylesheet to fire on click but not able to toggle it back to its original:
<button id="css_toggle" title="I'm a tooltip!">Text</button>
<div class="sq"></div>
$('#css_toggle').click(function () {
$('link[href="http://localhost:8888/rip-access/wp-content/themes/RIP/assets/css/style.css"]').attr('href', 'http://localhost:8888/rip-access/wp-content/themes/RIP/assets/css/style1.css').toggle();
});
this is a VERY simple example so I can understand how to do it before I continue on. Any ideas how I can get it toggle back to the first stylesheet?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…