$.fn.longPress = function(fn) {var timeout = undefined;var $temThis = this;//var $(this) = this;for(var i = 0;i<$temThis.length;i++){$temThis[i].addEventListener('touchstart', function(event) {timeout = setTimeout(fn, 800);}, false);$temThis[i].addEventListener('touchend', function(event) {clearTimeout(timeout);}, false);}return this;}$('.common-get-input').longPress(function(){$(this).hide();//這里的this不能指向我想要的?請問怎么解決?console.log('changan');});這里的this不能指向我想要的?請問怎么解決?
- 3 回答
- 0 關注
- 694 瀏覽
添加回答
舉報
0/150
提交
取消