Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

83
Visualizações
Troubles with touch events jquery

First of all, I'm new with javascript so sorry if that sounds stupid haha

I'm trying to write some code to create a drag and drop minigame. So far I'm having a problem with the touchable part of the code. When I added the draggable option (with cursor only) it worked perfectly. But I tried to add some touchable code (to allow people on phones or tablets to use it as well) using this tuto : https://www.kirupa.com/html5/drag.htm .

I have two problems though :

  • How do I trigger droppable touch events ? It works with mouse with the code below, but I can't figure how to do the same and for exemple trigger an alert when we drop with touchend ?

    $('#lundi').droppable({
      drop: handleDropEvent 
    })
    
    function handleDropEvent(event, ui) {
      var draggable = ui.draggable;
      alert('On a drop "' + draggable.attr('id') + '" sur moi !');
    }
    

I've tried Touch Punch but it didn't change anything, so I don't know if I did something wrong of if this just doesn't work ?

  • Why does my cursor is not hidden when I drag an item with mouse despite the :active cursor: none ? It does hide when I click in the container but not when I click the item and drag. Also, the cursors is "pointer" everywhere in the page, while it should be only on the .yobi .

You can see the problem here : http://jsfiddle.net/uy0m5L8c/

Thanks a lot for your kind help !

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda