Safari 5.1中禁用了CSS样式切换器
我的网页上有这个基于jQuery的CSS样式切换器.当我将浏览器更新为Safari 5.1时,此脚本停止工作.我环顾四周,看到这苹果讨论页,其原因是替代样式表已在Safari 5.1中禁用.谁能帮助我解决此问题?我不是程序员,所以我无法弄清楚.
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.
作者页面 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);
找到了与Safari 5兼容的jQuery脚本的链接.
Found a link to a jQuery script that works with Safari 5.
http://electrokami.com/coding/jquery-style -sheet-switcher-with-preview/