2
Galera I set up a context menu that works like this, when the user right-click on a 'tr' table it opens.
I do so using jQuery:
// Verifica se abre o menu
$("tr").mousedown(function (e) {
//AQUI FICA AS FUNÇÕES DO MENU
});
Well, the problem is, when it’s opened on a cell phone, you don’t have the mouse.
I was wondering if you have any way to identify a click for 2 seconds, and open the menu.
Then it should open either with the right button or with a long click.
A lot with, that’s just what I needed, but how I’ll call the function '$("tr"). on( "taphold", Function( Event ) {' when the second is greater than 2?
– Hugo Borges
Precisely, it deals alone this @Hugoborges. So I edited putting time second only with jQuery :)
– BrTkCa
I’m trying to do this check, 'if (seconds > 0) {console.log("hi");}' but it doesn’t work, you know why?
– Hugo Borges
I needed to reverse the operators to not go negative @Hugoborges. I edited the answer :)
– BrTkCa
I’m not getting the menu open with a long click (and you have more than 1 second), can you help me? follow my code https://jsfiddle.net/hugoborges/50bh9t1a/2/
– Hugo Borges
@Hugoborges, I noticed he’s entering the condition normally, but nothing happens on the screen. Since it’s another matter, I suggest you open up another question if the problem is with the menu, so as not to branch out your question.
– BrTkCa