$('.color-box').colpick({
colorScheme:'dark',
layout:'rgbhex',
color:'ff8800',
onSubmit:function(hsb,hex,rgb,el) {
$(el).css('background-color', '#'+hex);
$(el).colpickHide();
}
})
.css('background-color', '#ff8800');
as you can see, I can set the default color of the colpick using color:ff8800.
But is there a way to set the color dynamically when the colorpicker is shown?
I mean, if I use a button to trigger this colpick ('#test1').colpick();
The test1 already has a background color, I wish to make something like
color: ('#test1').css(background-color)
rather than using the default color of colpick, which is color: ('#test1').css(background-color)
.
By the way, could someone tell me what does color: .css('background-color', '#ff8800')
mean? is this a chain function?
Thanks !