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

174
Visualizações
Mouseup after Draging without library

I have some pure css snap scroll functionality and I want to detect where an element is relative to the viewport after the user stop dragging. The thing is I don't wan't to use some fancy library because I don't need to actually move or drop something. I just wan't to fire an event on mouseup. My problem is that the mouseup event won't fire after I moved my cursor while having the left mouse button pressed. Btw. I'm using Vu3

<span id="handle" class="card-handle" onmouseup="myMethod"></span>

I hope to find a lightweight solution, scince I don't really need all this dragging functionality

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As far as I know you can try something like

<span id="handle" class="card-handle" ondragend="myFunction(event)" draggable="true"></span>

and in your methods

methods: {
   myFunction() {
    var x = e.clientX;
    var y = e.clientY;
    var coor = "Coordinates: (" + x + "," + y + ")";
    console.log(cor);
  }
}
about 4 years ago · Juan Pablo Isaza Relatório
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