Reputation: 85
I am using above library but could not be able to find anywhere that how can I close it by selecting any color without actually clicking anywhere in the screen (They must be using blur).
$('#colorSelector'+dynamicID).ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
$(colpkr).fadeOut(500);
return false;
},
onSubmit: function (hsb, hex, rgb) {
$('#colorSelector'+dynamicID).css('backgroundColor', '#' + hex);
}
});
I have tried using this
$(selector).colorpicker('close')
But it did not work but breaks everything.
Upvotes: 0
Views: 652
Reputation: 2603
Try closing the colorpicker on submit button
$('#colorSelector'+dynamicID).ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
$(colpkr).fadeOut(500);
return false;
},
onSubmit: function (hsb, hex, rgb) {
$('#colorSelector'+dynamicID).css('backgroundColor', '#' + hex);
$('#colorSelector').hide(); // closes the color picker on submit after selection of color
}
});
Upvotes: 1