看视频教程时,说到一个安卓机的bug,就是当手指点击页面的面积过大时会触发元素的滑动事件,这样会导致一些不想要的效果。就该问题实测了一番:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.box{
width: 300px;
height: 300px;
background: red;
font-size: 20px;
}
</style>
</head>
<body>
<div class="box">
<p></p>
<p></p>
</div>
<script>
(function () {
var box = document.querySelector('.box');
var p1 = box.childr