I have this jQuery based CSS style switcher in my webpage. When I updated the browser to Safari 5.1 this script stopped working. I looked around and saw this apple discussion page and the cause was alternate stylesheets has been disabled in Safari 5.1. Can anyone help me to work around this issue? I am not a programmer so I cannot figure this out.
Author’s page http://www.kelvinluck.com/assets/jquery/styleswitch/toggle.html
(function($)
{
$(document).ready(function() {
$('.styleswitch').click(function()
{
switchStylestyle(this.getAttribute("rel"));
return false;
});
var c = readCookie('style');
if (c) switchStylestyle(c);
});
function switchStylestyle(styleName)
{
$('link[rel*=style][title]').each(function(i)
{
this.disabled = true;
if (this.getAttribute('title') == styleName) this.disabled = false;
});
createCookie('style', styleName, 365);
}
})(jQuery);
Found a link to a jQuery script that works with Safari 5.
http://electrokami.com/coding/jquery-style-sheet-switcher-with-preview/