当前位置:网站首页>1. Mobile terminal touch screen event
1. Mobile terminal touch screen event
2022-07-01 04:15:00 【superfortunate】
touch Object represents a touch point . The touch point could be a finger , It could be a stylus . Touch screen events respond to user fingers ( Or a stylus ) Operation of the screen or touch pad .
| touchstart | Fingers touch a DOM Element trigger |
| touchmove | Finger in a DOM Triggered when sliding on an element |
| touchmove | Fingers from a DOM Triggered when the element is moved up |
var div = document.querySelector('div');
div.addEventListener('touchstart',function(){
console.log(' Touched ');
})TouchEvent It's a class that describes a finger on a touch plane ( Touch screen 、 Touchpad, etc ) The state of change of events . This type of event is used to describe one or more contacts , Enables developers to detect the movement of contacts , The increase and decrease of contacts , wait
touchstart、touchmove、touchmove Each has its own event object .
Three common object lists
| touches | A list of all fingers touching the screen |
| targetTouches | Touching the current DOM A list of fingers on the element |
| changedTouches | List of finger states that have changed , From scratch , From have to no |
div.addEventListener('touchstart',function(e){
console.log(e);
})
console.log(e.targetTouches[0]);// You can get what you are touching dom Information about the first finger of the element , Such as finger coordinates Happy study !
边栏推荐
- 206.反转链表
- Use winmtr software to simply analyze, track and detect network routing
- One job hopping up 8K, three times in five years
- Grid system in bootstrap
- 小程序中自定义组件
- Qt development experience tips 226-230
- Spock单元测试框架介绍及在美团优选的实践___第一章
- 什么是权限?什么是角色?什么是用户?
- Tip of edge browser: enter+ctrl can automatically convert the address bar into a web address
- 389. find a difference
猜你喜欢

283. move zero

HoloLens2开发环境搭建及部署app

Class and object finalization
![[ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline](/img/af/4498382bc47d8c9ae41c407b9d1265.png)
[ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline
![[human version] Web3 privacy game in the dark forest](/img/89/e16789b7f3892002748aab309c45e6.png)
[human version] Web3 privacy game in the dark forest

It's settled! 2022 JD cloud summit of JD global technology Explorer conference see you in Beijing on July 13

Visit the image URL stored by Alibaba cloud to preview the thumbnail directly on the web page instead of downloading it directly
【历史上的今天】6 月 30 日:冯·诺依曼发表第一份草案;九十年代末的半导体大战;CBS 收购 CNET

采购数智化爆发在即,支出宝'3+2'体系助力企业打造核心竞争优势

Jenkins自动清理构建历史
随机推荐
LeetCode 1400. Construct K palindrome strings
为什么香港服务器最适合海外建站使用
JMeter login failure, extracting login token, and obtaining token problem solving
[JPCs publication] the Third International Conference on control theory and application in 2022 (icocta 2022)
Codeforces Round #721 (Div. 2)B1. Palindrome Game (easy version)B2. Palindrome game (hard version)
Millet College wechat scanning code login process record and bug resolution
[untitled]
定了!2022京东全球科技探索者大会之京东云峰会7月13日北京见
js 图片路径转换base64格式
The programmer's girlfriend gave me a fatigue driving test
[leetcode skimming] February summary (updating)
OSPF notes [multiple access, two multicast addresses with OSPF]
陈宇(Aqua)-安全->云安全->多云安全
Hololens2 development environment building and deploying apps
674. longest continuous increasing sequence force buckle JS
How to ensure the idempotency of the high concurrency interface?
[ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline
Account sharing technology enables the farmers' market and reshapes the efficiency of transaction management services
嵌入式系统开发笔记79:为什么要获取本机网卡IP地址
25.K个一组翻转链表