Home > front end >  Tablet is forbidden, the long press the pop-up menu by default
Tablet is forbidden, the long press the pop-up menu by default

Time:09-24

I tried a lot of kinds of methods, not on tablets, mobile phone, I can do that, just will give me click event to disable, PC ban right-click is successful, but why the tablet is washed-up, looking for a day, the people want Fried
1,
$(" body "). The addEventListener (' contextmenu ', function (e) {
E.s topPropagation ();
});
2,
$(" body "). Ontouchstart=function (e) {
E.s topPropagation ();
};
3,
The $(document). Ready (function () {
$(" body "). The CSS (" - moz - user - select ", "none");
});
4,
The body {
- its - touch - the callout: none;
-webkit-user-select:none;
- the KHTML - user - select: none;
- moz - user - select: none;
- ms - user - select: none;
The user to select: none;
}

CodePudding user response:

 

Var date;
Document. The addEventListener (' touchstart 'event=& gt; {
The date=new date (). GetTime ();
});
Document. The addEventListener (' touchend 'event=& gt; {
If (new Date (). GetTime () - Date & gt; 600)
event.preventDefault();
});

CodePudding user response:

reference 1/f, the sky wave response:
 

Var date;
Document. The addEventListener (' touchstart 'event=& gt; {
The date=new date (). GetTime ();
});
Document. The addEventListener (' touchend 'event=& gt; {
If (new Date (). GetTime () - Date & gt; 600)
event.preventDefault();
});

As if is useless, I use the android tablet
  • Related