Created
March 21, 2013 19:33
-
-
Save alejandroiglesias/5215983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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