Safari 5.1中禁用了CSS样式切换器 [英] CSS style switcher disabled in Safari 5.1

查看:116
本文介绍了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/

这篇关于Safari 5.1中禁用了CSS样式切换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆