Created
April 24, 2013 08:45
-
-
Save the-teacher/5450680 to your computer and use it in GitHub Desktop.
Jquery plagin template
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
$('selector').smartDataInputs() | |
(($) -> | |
# e.keyCode e.shiftKey e.ctrlKey e.altKey e.metaKey | |
# keydown => keypress => keyup | |
$.fn.smartDataInputs = (options) -> | |
block = @ | |
inputs = block.children('input') | |
params = $.extend {}, options | |
day = $ inputs[0] | |
month = $ inputs[1] | |
year = $ inputs[2] | |
$(block).on 'keydown', day, (e) -> | |
log 'keydown' | |
$(block).on 'keyup', day, (e) -> | |
log 'keyup' | |
$(block).on 'keypress', day, (e) -> | |
log 'keypress' | |
@ | |
)(jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment