Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

82
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda