Hi Rog,
What you're asking is perfectly possible.
This is how I would do it:
- Inside the div you want to be click you put an input element with
zero padding and margin, 100% width and height and opacity:0.
All Q modules need to be attached to an input and in this way the
input is present but not at all visible.
- Than you add an onPick or onChange callback which is setting the
background-color of the div:
document.observe('q:loaded', function() {
new Q.Palette("id_of_the_input", {
colors: ['#31332E','#585C53','#868C7F','#E0E3DC'],
onPick: function(hex) {
$("id_of_the_div").setStyle({ backgroundColor: hex });
}
});
});
Geetings,
Wout