一、tapmode具有速點擊事件功能,在觸發事件中加入tapmode可以消除JS中標準click事件的300毫秒延遲;
二、tapmode具有觸發可顯示樣式的效果,tapmode=’css樣式類’屬性,,當該元素touchstart touchmove的時候就會展現css樣式。
eg:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>設置</title>
<link rel="stylesheet" type="text/css" href="../css/api.css" />
<style>**重點內容**
body{
height: 12rem;
width: 100%;
background-color: #B0C4DE;
}
.ljl{
width: 200px;
height: 40px;
border-radius: 10px;
line-height: 40px;
background-color: #ffcccc;
margin: 0 auto;
margin-top: 40px;
}
</style>
</head>
<body>
<div class="ljl" tapmode onclick="yes()">請問你願意和我共度餘生嗎</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function() {
};
function yes() {
alert("是的我願意");
}
</script>
</html>