jQuery jPicker > Assign color of jPicker from a text link (not from jPicker)
- by Scott B
I've got a list of frequently used hex colors that I'd like to list under my jPicker bound input text field and I'd like to figure out how to change the value of the jPicker active color without opening the jPicker color selector palette.
I've managed to create a function that updates the input field thats bound to the jPicker, but the colors of the background and picker.gif do not update. I'd like to force the background colors to update as if the color was selected from jPicker itself.
Here's my code for the activation link...
<span onclick=doColor(1,'cc9900')>cc9900</span>
And here's the js handler
function doColor(el, color)
{
if(el){$('#theme_header_color').attr('value', color);}
else{$('#theme_sidebar_color').attr('value', color);}
}