$.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 关注
- 667 浏览
添加回答
举报
0/150
提交
取消