Sé que hay un complemento llamado .hasClass();jQuery elemento de verificación ID
Tengo el siguiente
$('#page_background, #header_background').ColorPicker({...
cómo iba a comprobar si se hace clic en page_background y no header_background?
Esto es lo que tengo ahora, no funcionará.
$('#page_background, #header_background').ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
$(el).val(hex);
$(el).ColorPickerHide();
var id = this.id;
if(id == 'page_background')
$('body').css("background-color","#"+hex);
},
onBeforeShow: function() {
$(this).ColorPickerSetColor(this.value);
}
})
.bind('keyup', function(){
$(this).ColorPickerSetColor(this.value);
});
estás buscando el id 'background_color' howe ver que no está vinculando el evento de clic a un elemento que tiene esa identificación. (basado en la edición que acaba de revertir, supongo) –