-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
54 lines (35 loc) · 1.06 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* javascript -> jQuery generic template file
* ============================================================================================== */
$(document).ready(function(){
$(document).keypres();
//$('form .link').keypres();
//Now use...
//var dom = $('form').data('watermark');
});
(function($) {
$.keypres = function( element , options ){
$settings = {};
element.data('watermark' , this);
this.init = function(element , options){
$settings = $.extend( {} , $.keypres.defaultOptions , options );
this.event();
};
this.event = function() {
element.on('keypress', function(e) {
});
//this.options
}
// init element function
this.init( element , options );
};
//setup options metod
$.fn.keypres = function(options) {
return this.each(function() {
(new $.keypres($(this), options));
});
};
// default options
$.keypres.defaultOptions = {
keycode: 13 // default keycode for enter
}
})(jQuery);