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

86
Views
jquery hover not working after being moved

I want to make a "catch the button game" so I have to move a button and if I move it the hover event doesn't work anymore. I tried it with normal js but that didnt help either.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

In the Case of the Dynamically added elements, It is better to add the event with the parent element. So you can use 'html' or 'body' tag for that.

.on(events[,selector][,data],handler)

$(document).ready(function () {
    $('html').on('hover', '.btnClass', function () {
        // do you work
    })
}); 
about 4 years ago · Juan Pablo Isaza Report

0

Probably because you have a dynamic added element(button). Therefor you need to use the .on using jQuery. ✌️

$(".buttonClass").on("hover", function () {
// your function.
});
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!