Reputation: 1023
I have several jpickers. For ex: I want to change body background color meanwhile changing color in jpicker. How to handle color change event in jpicker?
js:
$('#colorSelector').jPicker(
{
window:{expandable:true}
});
html
<span id="colorSelector"></span>
Any idea?
Thanks.
Upvotes: 0
Views: 1268
Reputation:
Something like this
$('#Callbacks').jPicker(
{},
function(color, context)
{
var all = color.val('all');
alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none'));
$('#Commit').css(
{
backgroundColor: all && '#' + all.hex || 'transparent'
}); // prevent IE from throwing exception if hex is empty
}
);
Look there: http://www.digitalmagicpro.com/jPicker/
Upvotes: 1