当前位置:网站首页>Simulate long press event of mobile device
Simulate long press event of mobile device
2022-06-21 07:19:00 【Glow rabbit】
Pure click event monitoring results in the mobile device , For a long time, it is impossible to collect data according to behavior events , Resulting in incomplete data . Therefore, it is necessary to determine whether the visitor has a long press action to copy the copy in the element , At the same time, obtain the behavior data .
// Add a long press event on the mobile terminal touch Judge , Avoid inaccurate event collection data
$(".pt_off_event").on({
touchstart: function(e) {
var eleTarget = e.srcElement || e.target;
// Long press event triggers
timeOutEvent = setTimeout(function() {
timeOutEvent = 0;
ptengine.track(eleTarget.textContent, {}, {
transport: 'beacon'
});
}, 500);
// Long press 500 millisecond
// e.preventDefault();
},
touchmove: function() {
clearTimeout(timeOutEvent);
timeOutEvent = 0;
},
touchend: function() {
clearTimeout(timeOutEvent);
if (timeOutEvent != 0) {
console.log(' You click on the ');
}
return false;
}
})
边栏推荐
- Trick or treat SVG Halloween JS special effect
- What is Eureka? What can Eureka do? How does Eureka work?
- [regular expression daily skill] escape characters with special meanings in regular expressions
- WordPress实现左边栏显示文章目录
- 2022年大学英语六级6月翻译
- June training (day 21) - heap (priority queue)
- 数据分析之:不同行业的常见指标
- Two ideas of I2C driver implementation (I2C dev.c and I2C core.c)
- Eigen common operations
- Two column set (map set)
猜你喜欢

【osg】OSG开发(03)——构建MSVC版的osgQt库

Geo2r: difference analysis of data in geo database

【转】刘润:不要和没有逻辑的人讨论业务

Using XAML only to realize the effect of ground glass background panel

Yield Guild Games 与 Walken 达成合作

Microphone loading animation

远程辅助必备免费神器ToDesk远程控制软件(答辩,远程,调试,办公)必备远程工具

win10上vs2017配置Eigen3开发环境

什么是Eureka?Eureka能干什么?Eureka怎么用?

C skill tree evaluation
随机推荐
Unittest使用
June training (day 21) - heap (priority queue)
微信小程序_6,网络数据请求
Pinia advanced: elegant setup (functional) writing + encapsulation into your enterprise project
SaaS multi lease mall system in logistics industry improves logistics management efficiency and realizes efficient collaboration
海思系列量产硬件调试记录
How to use MES management system to realize error prevention and early warning
app安全滲透測試詳細方法流程
[transfer] liurun: don't discuss business with people without logic
Filtre Bloom
Can customer managers be relied on online? Is the fund safe
怎么看小程序是谁开发的(查看小程序开发公司方法)
Google Earth Engine(GEE)——全球农田有机土壤碳和氮排放(1992-2018年度)数据集
缺失数据填补数据集介绍(2)——多种数据集介绍及数据集预处理(mushroom、news、spam、wine-red和yeast)
数据库与缓存数据一致性问题
Open up the connection between production and marketing and build a new digital supply chain of agricultural and sideline products
Yield Guild Games 与 Discord 上的第一款 MMORPG ——Tatsumeeko 达成合作
集线器、交换机、路由器
Course design of supply chain modeling and simulation based on Flexsim
[flutter special topic] 72 graphic minimalist custom running lamp acemarquee yyds dry goods inventory