Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda