Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

html - Jquery contextmenu event not working on ios/Safari, instead long press is opening the default copy-paste menu

I have a div which is supposed to open a custom menu. Therefore I am using Jquery's contextmenu event.

Currently I am binding the event this way:

$( "#idDiv" ).contextmenu(function() {
  alert( "Handler for .contextmenu() called." );
});

I also tried to bind it like this:

$( "#idDiv" ).on('contextmenu', function() {
   alert( "Handler for .contextmenu() called." );
});

I even tried disabling the default ios behaviour for longpress by using:

body { -webkit-touch-callout: none !important; }
input { -webkit-user-select: none !important; }

Still it didn't work. Can anyone help me with this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...