Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to toggle css stylesheets Re: How to toggle css stylesheets

#95463
JohnMotylJr
Participant
$(function()
{
// Call stylesheet init so that all stylesheet changing functions
// will work.
$.stylesheetInit();

// This code loops through the stylesheets when you click the link with
// an ID of "toggler" below.
$('#toggler').bind(
'click',
function(e)
{
$.stylesheetToggle();
return false;
}
);

// When one of the styleswitch links is clicked then switch the stylesheet to
// the one matching the value of that links rel attribute.
$('.styleswitch').bind(
'click',
function(e)
{
$.stylesheetSwitch(this.getAttribute('rel'));
return false;
}
);
}
);

reference:What @df0gge said lol…