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

145
Views
shorted Jquery by using each() function

How can i shorted this jquery by using each() function? or have another method to shorted this jquery?

            $("div.body-t-option-1").hover(function() {
                $(".body-t-img-2,.body-t-img-3,.body-t-img-4").hide();
                $(".body-t-img-1").show();
                $(".body-t-img-1").addClass('animated fadeInLeft');
            });

            $("div.body-t-option-2").hover(function() {
                $(".body-t-img-1,.body-t-img-3,.body-t-img-4").hide();
                $(".body-t-img-2").show();
                $(".body-t-img-2").addClass('animated fadeInLeft');
            });

            $(".body-t-option-3").hover(function() {
                $(".body-t-img-1,.body-t-img-2,.body-t-img-4").hide();
                $(".body-t-img-3").show();
                $(".body-t-img-3").addClass('animated fadeInLeft');
            });

            $(".body-t-option-4").hover(function() {
                $(".body-t-img-1,.body-t-img-2,.body-t-img-3").hide();
                $(".body-t-img-4").show();
                $(".body-t-img-4").addClass('animated fadeInLeft');
            });

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

0

how are u? suggestion, currently it is recommended to use the events as follows

$(document).on('hover', 'div.body-t-option-1', () => {
    //code...
});

$(document).on('click', '#something', () => {
    //code...
});

now, regarding the question, let me suggest that you reformulate it by adding more information for example with an html template in order to understand your desired output

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!