Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

218
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda