I'm using jQuery colorpicker on an app. When a color is selected and being selected, the color is displayed in a span class ".swatch". However, when there are two color select options on a single page, the span.swatch will both display the same color as the color is being selected. (see screenshot).
Screenshot here: http://cl.ly/2MUU
Here is the code I'm using
jQuery('.colorselect').ColorPicker({
onSubmit: function ( hsb, hex, rgb, el ) {
jQuery(el).val(hex);
jQuery(el).ColorPickerHide();
},
onBeforeShow: function () {
jQuery(this).ColorPickerSetColor(this.value);
},
onChange: function (hsb, hex, rgb) {
jQuery('.swatch').css('backgroundColor', '#' + hex);
}
})