Block mobile browser popup by pressing screen element

Asked

Viewed 95 times

0

Description:

A friend is developing an application in which a web page is accessed and when interacting with the elements is sent to a file PHP controls to manipulate a robot with the Arduino. For now we are doing just turn on the leds, the following is done using the events of jQuery:

  1. mousedown touchstart: To turn on the led when the mouse is pressed on the element using a desktop and mobile browser.

  2. mouseup touchend: To turn off the led when not with the mouse pressed on the element using a desktop and mobile browser.

Problem:

In mobile browser, be it Chrome or Firefox, while leaving pressed for a few seconds popup appears to perform an action with the browser, but I just want to turn on/off the led and the appearance of this popup is disturbing when turning off the led.

Proper procedure

Do not pop up and allow to turn off the led.

Attachments

Popup Chrome

  • within the function, you certainly have the event variable, commonly called e . You could try, first of all, to add e.preventDefault();and check if the "problem" still occurs.

1 answer

0

The problem was solved by adding the following block CSS:

img {
    -webkit-touch-callout: none !important; 
}
  • This will only work with browsers that use Webkit. You will actually use just these?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.