【问题标题】:Why isn't the jQuery Color Picker Plug-in working for me in Firefox?为什么 jQuery 颜色选择器插件在 Firefox 中不适合我?
【发布时间】:2009-11-14 19:56:09
【问题描述】:

我正在尝试将 JQuery color picker plug-in 附加到文本框。相同的代码适用于 IE 6 和 7,但不适用于 FireFox。我没有看到任何类型的错误或警告感觉,就好像插件代码被忽略了一样。

    <script src="/colorpicker.js" type="text/javascript"></script>

    <script type="text/jscript">
    jQuery(function() {
        $('#TextColor').ColorPicker({
            onSubmit: function(hsb, hex, rgb, el) {
                $(el).val(hex);
                $(el).ColorPickerHide();
                //sets bg color of prev div
                $('#' + el.id + 'Prev').css('backgroundColor', '#' + hex);
            },
            onShow: function(colpkr) {
                $(colpkr).fadeIn(500);
                return false;
            },
            onHide: function(colpkr) {
                $(colpkr).fadeOut(500);
                return false;
            },
            onBeforeShow: function() {
                $(this).ColorPickerSetColor(this.value);
            }
        })
    .bind('keyup', function() {
        $(this).ColorPickerSetColor(this.value);
    });
    });
</script>

当前脚本位于页面底部,但我尝试在顶部加载插件代码,在底部加载设置代码。 欢迎所有建议。

【问题讨论】:

    标签: javascript jquery jquery-ui jquery-plugins


    【解决方案1】:

    试试&lt;script type="text/javascript"&gt;..&lt;/script&gt;

    第一次用,第二次用text/jscript

    【讨论】:

    • 哇,你成功了,我不敢相信我错过了我已经盯着这段代码几个小时了。 IE 忽略了 firefox 忽略我的代码的错字。谢谢。
    猜你喜欢
    • 2011-02-16
    • 1970-01-01
    • 2012-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-21
    • 1970-01-01
    相关资源
    最近更新 更多