http://acko.net/dev/farbtastic
I would like to have multiple INPUTs, and users can change the color for each. However, each input is synchronized with some other classes (for example, the background color of the background or the background color of the menu).
I want to be able to change color using Farbtastic Color Picker, and it affects the BOTH INPUT and CLASS / ID, which are synchronized with INPUT. How to do it? In the example below, the color in "colorwell" only changes, but how to synchronize another C # color1, # color2 ... element separately? Thanks
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#demo').hide();
var f = $.farbtastic('#picker');
$('.colorwell')
.each(function () { f.linkTo(this); })
.focus(function() {
f.linkTo(this);
});
});
</script>
<form action="" style="width: 500px;">
<div id="picker" style="float: right;"></div>
<div class="form-item"><label for="color1">Color 1:</label><input type="text" id="color1" name="color1" class="colorwell" value="#123456" /></div>
<div class="form-item"><label for="color2">Color 2:</label><input type="text" id="color2" name="color2" class="colorwell" value="#123456" /></div>
<div class="form-item"><label for="color3">Color 3:</label><input type="text" id="color3" name="color3" class="colorwell" value="#123456" /></div>
</form>
source
share