I have these widgets with a sliding box inside. There are two widgets when the page is loaded, but you can add a widget and delete it again.
Inside the sliding box is a color picker, and on the starter widgets the color picker works properly, but in the added widgets the color picker doesn't work.
See this fiddle: http://jsfiddle.net/fULQZ/
I think the error is in the script for the color picker?
Here's the script for the color picker:
// Color picker
function updateBackground(color) {
$(this).parents(".box_header").css("background", color.toHexString());
}
$(function() {
$(".flatPalette").spectrum({
flat: true,
showInput: true,
showPaletteOnly: true,
showPalette:true,
maxPaletteSize: 10,
palette: [
['#DDD','#9fd0d3', '#c9a9d1', '#e2a6a5', '#c2d2bd','#9fb2d1', '#dbba97', '#cbefe9', '#e6e8bf'],
[]
],
change: updateBackground
});
});