Skip to content

Instantly share code, notes, and snippets.

@evanhutomo
Created February 6, 2015 09:14
Show Gist options
  • Save evanhutomo/842d245a72cddf96728b to your computer and use it in GitHub Desktop.
Save evanhutomo/842d245a72cddf96728b to your computer and use it in GitHub Desktop.
little mod for color picker from http://vanderlee.github.io/colorpicker/
//because of colorpicker object use catch click event, I use onHover event to get the id's
$('tr.txtMark td input[type=text]').on('hover', function(){
var sID = $(this).attr('id');
$('#' + sID).colorpicker({
title: "Header Background Colour",
dragggable: true,
closeOnOutside: false,
revert: true,
parts: ['header', 'map', 'bar', 'hex', 'preview', 'footer'],
ok: function () {
var colorVal = $('#' + sID).val();
$('#' + sID).val('#' + colorVal);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment