Skip to content

Instantly share code, notes, and snippets.

@1Marc
Created August 8, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1Marc/1132317 to your computer and use it in GitHub Desktop.
Save 1Marc/1132317 to your computer and use it in GitHub Desktop.
custom event proxy to custom template component
.bind('xgcolor:hsbmove' + ns, $.proxy(function(e) {
var pos = $(this).offset(),
hsbcolor = $.xgcolor.options.hsbcolor;
hsbcolor.b = parseInt(100*(126 - Math.max(0,Math.min(126,(e.pageY - pos.top))))/126, 10);
hsbcolor.s = parseInt(100*(Math.max(0,Math.min(130,(e.pageX - pos.left))))/130, 10);
$.xgcolor._setColor(hsbcolor);
}, this.get('hsbselector')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment