【发布时间】:2015-08-18 04:44:00
【问题描述】:
我正在尝试在 jQuery 对话框上显示 Spectrum 颜色选择器,但它没有显示出来。这是我用于加载频谱的代码:
$(document).ready(function() { $("#colour").spectrum({color: "#f00" });});
在我的 jQuery 对话框中为 div 着色。 这是初始化对话框的代码:
dialogObj = $("#_dialogPanel").dialog({
autoOpen: false,
resizeable: true,
position: { my: "center-100 bottom-40", at: "center center" },
stack: true,
height: 'auto',
width: 'auto',
modal: true
});
$("#_dialogPanel").submit( function(e) {
e.preventDefault();
});
dialogObj.dialog("open");
对话框中的内容是动态加载的:
$("#_dialogPanel").empty().html(response);
$(document).ready(function() { $("#colour").spectrum({color: "#f00" });});
“响应”:
<div name='colour' id='colour' />
对spectrum.js和spectrum.css的引用添加到母版页
【问题讨论】:
标签: javascript jquery color-picker