N
N
Name2017-09-06 12:28:40
Animation
Name, 2017-09-06 12:28:40

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%'
})

now when scrolling up, the word class is removed and the words class is added, but the words animation does not fire
velocity.js
$('.word')
 .velocity('transition.perspectiveLeftIn')  ;
$('.words')    
 .velocity('transition.perspectiveLeftOut');

What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question