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.
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)
})