jquery > 手机端 onClick 延迟解决

使用 https://github.com/ftlabs/fastclick

<script type="text/javascript" src="./js/fastclick.js"></script>
<script type="application/javascript">
	window.addEventListener('load', function() {
		var  testB = document.getElementById('test-b');

		// Android 2.2 needs FastClick to be instantiated before the other listeners so that the stopImmediatePropagation hack can work.
		FastClick.attach(testB);

		testB.addEventListener('click', function(event) {
			alert('aaaaaa');
		}, false);
	}, false);
</script>
<div class="test" id="test-b">B</div>

猜你喜欢

转载自mft.iteye.com/blog/2115470