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

89
Vistas
Prevent click after dragging

I have a draggable icon that opens a popup when clicked, but it opens the popup if you drag the icon and then let go of the mouse button. I need to stop this from happening.

I had this figured out but messed up my code. If someone can adjust my code below to stop the click happening after drag, that would be super helpful!

jQuery(document).ready(function($) {
  $(function() {
    $(".icon").draggable({
      containment: "#containment-wrapper",
      stop: function(e, ui) {
        var perc = ui.position.left / ui.helper.parent().width() * 100;
        ui.helper.css('left', perc + '%');
      }
    })
    
    $("[data-popup]").on('click', function() {
      var target = $(this).data('popup');
      target = "#" + target;
      var $targetEl = $(target)
      $targetEl.show();
      $targetEl.css('zIndex', popupZIndex);
      popupZIndex += 1;
    });
  });
});

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