Guest User

Untitled

a guest
Jan 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function ioHandler(entries) {
  2. for (let entry of entries) {
  3. entry.target.style.opacity = entry.intersectionRatio.toFixed(2);
  4. entry.target.addEventListener('click', function(e) {
  5. if (this.nextElementSibling !== null) {
  6. this.nextElementSibling.scrollIntoView({
  7. 'behavior': 'smooth'
  8. });
  9. }
  10. },true);
  11.  
  12. if (entry.intersectionRatio > .5) {
  13. entry.target.classList.add('active')
  14. } else {
  15. entry.target.classList.remove('active')
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment