Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!