3 function pickColor(color) {
4 farbtastic.setColor(color);
5 jQuery('#background-color').val(color);
6 jQuery('#custom-background-image').css('background-color', color);
9 jQuery(document).ready(function() {
10 jQuery('#pickcolor').click(function() {
11 jQuery('#colorPickerDiv').show();
15 jQuery('#background-color').keyup(function() {
16 var _hex = jQuery('#background-color').val(), hex = _hex;
19 hex = hex.replace(/[^#a-fA-F0-9]+/, '');
21 jQuery('#background-color').val(hex);
22 if ( hex.length == 4 || hex.length == 7 )
26 jQuery('input[name="background-position-x"]').change(function() {
27 jQuery('#custom-background-image').css('background-position', jQuery(this).val() + ' top');
30 jQuery('input[name="background-repeat"]').change(function() {
31 jQuery('#custom-background-image').css('background-repeat', jQuery(this).val());
34 farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) {
37 pickColor(jQuery('#background-color').val());
39 jQuery(document).mousedown(function(){
40 jQuery('#colorPickerDiv').each(function(){
41 var display = jQuery(this).css('display');
42 if ( display == 'block' )
43 jQuery(this).fadeOut(2);