
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 0.62 KB | hits: 26 | expires: Never
Color change event handling in jpicker
$('#colorSelector').jPicker(
{
window:{expandable:true}
});
<span id="colorSelector"></span>
$('#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
}
);