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

216
Views
change the jquery code from old version to new version

Good morning i found this js that i would like to use, but i saw that the jquery version it's old (2.1.3) and if i add a new version (3.6) of the jquery it doesn't work.

How i can change the code to make it work? Here the code:

$(window).load(function(){
        setTimeout(function(){
            $('#preloader').velocity({
                opacity : 0.1,
                translateY: "-80px"
            }, {
                duration: 400,
                complete: function(){
                $('#hola').velocity({
                translateY : "-100%"
            }, {
                duration: 1000,
                easing: [0.7,0,0.3,1],
                complete: function(){
                    $('.home').addClass('animate-border divide');
                }
            })  
                }
            })
        },1000)
    })

Here you can see the link to a codepen: https://codepen.io/uavide/pen/qBoaadr Many thanks Davide

I found the problem and i changed so now it works with jquery version 3.6

 $(window).on('load', function () {
        setTimeout(function(){

but now the problem it's with velocity that it doesn't work with the version 2.0.6 (but it work with the version 1.2.3.) and i don't understand why, just the animation it stops after the loader finish to load and it doesn't open the page.

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

0

I found the problem: Velocity doesn't support transform since version 2.0 (WTF)... So you have to add like css

Here the code that it works with jquery 3.6 and velocity 2.0.6

 $(window).on('load', function () {
        setTimeout(function(){
            $('#preloader')
      .velocity({opacity : 0.1, transform: ["translateY(-100px)", "translateY(0px)"] },
       {duration: 400, complete: function(){
         
                $('#hola')
     .velocity({transform: ["translateY(-100%)", "translateY(0px)"]}, 
      {duration: 1000, easing: [0.7,0,0.3,1], complete: function(){
        
                    $('.home').addClass('animate-border divide');
                }
            })  
                }
            })
        },1000)
    })
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!