Skip to content

Instantly share code, notes, and snippets.

@alejandroiglesias
Created March 21, 2013 19:33
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 alejandroiglesias/5215983 to your computer and use it in GitHub Desktop.
Save alejandroiglesias/5215983 to your computer and use it in GitHub Desktop.
var Slider = function (options) {
var defaults = {
horizontal: false,
vertical: true,
y: 0.5,
animationCallback: function (x, y) {
var frame = Math.ceil(y * 35);
this.wrapper.parentNode.className = 'snicker-blue ' + 'snicker-tiptop-' + frame;
}
};
var drag = new Dragdealer(wrapper, Object.merge(defaults, options));
Mousetrap.bind(options.keys.increase, function (event, combo) {
console.log('increase');
});
Mousetrap.bind(options.keys.decrease, function (event, combo) {
console.log('decrease');
});
return drag;
};
var sliderTip = new Slider({
wrapper: 'slider-tip',
keys: {
increase: 'q',
decrease: 'a'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment