1/* 2 @ ì¬ì©ë² 3 $(this).tabClick({ 4 touchStart : function() { console.log('ììì ììëë©´ ì¤í'); } 5 ,touchMove : function() { console.log('ììì ìì ë ìíìì ì´ëí ëë§ë¤ ì¤í'); } 6 ,touchEnd : function() { console.log('íë©´ìì ìì ë¼ë©´ì¤í'); } 7 }); 8*/ 9 10;(function($){ 11 // íë©´ì ëë¥´ê³ ëì ì´ëíì§ ìê³ íë©´ìì ë¼ë©´ completeë©ìëê° ì¤íëë¤. 12 $.fn.tabClick = function(options) 13 { 14 var 15 $this = $(this), 16 $defaults = { 17 touchStart : function($this) {}, 18 touchMove : function($this) {}, 19 touchEnd : function($this) {} 20 }, 21 $opts = $.extend($defaults, options), 22 $move, 23 is_touch_device = function() { 24 return !!('ontouchstart' in window) // works on most browsers 25 || !!('onmsgesturechange' in window && window.navigator.msMaxTouchPoints) // works on ie10 26 ; 27 }, 28 _init = function() 29 { 30 //console.log(window.navigator.msMaxTouchPoints); 31 //console.log(is_touch_device()); 32 if (is_touch_device()) { 33 $this.bind('touchstart', onTouchStart); 34 $this.bind('touchmove', onTouchMove); 35 $this.bind('touchend', onTouchEnd); 36 //console.log('touch'); 37 } else { 38 $this.bind('click', function(){ 39 $opts.touchEnd($(this)); 40 return false; 41 }); 42 } 43 } 44 ; 45 46 function onTouchStart() 47 { 48 $move = false; 49 $opts.touchStart($(this)); 50 } 51 52 function onTouchMove() 53 { 54 $move = true; 55 $opts.touchMove($(this)); 56 } 57 58 function onTouchEnd() 59 { 60 if (!$move) { 61 $opts.touchEnd($(this)); 62 return false; 63 } 64 } 65 66 _init(); 67 } 68})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.