vendredi 8 janvier 2016

JQuery button to disable CSS across entire website?

I want to make these buttons which enable/disable the css across an entire website I am making. I am trying to make it so when a user clicks the button to disable/enable the css, it does so across all the webpages of the site and not just for the page a user is on.

So far, my code to enable/disable the css is as follows

<script>
$("#text-only").click(function () { jQuery('#mainStyleSheet').remove();}); 
$("#renable-style").click(function () {$('head').append('<link href="css/style.css" rel="stylesheet" id="mainStyleSheet" />');});
</script>

Any ideas?




Aucun commentaire:

Enregistrer un commentaire