Answer the question
In order to leave comments, you need to log in
Re-animation on scroll (velocity.js and waypoints.js )?
When scrolling down the page, the animation is triggered, the word
waypoints.js class is added
var waypoint = new Waypoint({
element: document.getElementById('mov2'),
handler: function(dir) {
if (dir === 'down') $('#mov2').addClass('word').removeClass('words');
else $('#mov2').removeClass('word').addClass('words').width();
},
offset: '80%'
})
var waypoint = new Waypoint({
element: document.getElementById('mov2'),
handler: function(dir) {
if (dir === 'down') $('#mov2').addClass('words').removeClass('word');
else $('#mov2').removeClass('words').addClass('word');
},
offset: '-20%'
})
$('.word')
.velocity('transition.perspectiveLeftIn') ;
$('.words')
.velocity('transition.perspectiveLeftOut');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question