Home > front end >  Js ban mobile end various browser pop-up menu by default
Js ban mobile end various browser pop-up menu by default

Time:12-21

Js ban cell phones long press pop-up menu, but he gave long press events also to banned
I am using tencent AlloyFinger gesture library long press events
 var ent4=document. GetElementById (" ent4 "); 
The Transform (ent4);
New AlloyFinger (ent4, {
LongTap: function (evt) {
$(". Cfposk "). Show (" drop ");
$(" # cfpo - ent4 ".) the show (" drop ");
$(ent4). CSS ({" z - index ":" 12 ", "background" : "# c9cc19}");
Evt. The preventDefault ();
},
TouchEnd: function (evt) {
$(". Cfposk "). Hide (" drop ");
$(" # cfpo - ent4 "). Hide (" drop ");
$(ent4). CSS ({" background ", "transparent", "z - index", "10"});
Evt. The preventDefault ();
}
});

When I long to ban the pop-up menu by default,
* {
- 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;
}
$(" # ent4 ") on (' touchstart ', function (e) {
e.preventDefault();
}, false);
Can on Safari, but huawei browser that write on the tablet, though cannot be banned all pages in length according to the popup menu, but I need to ban long according to the elements of the popup menu, but not huawei browsers on mobile phones, banned long press pop-up menu also write my own long press click events to banned,
  • Related