Guest User

Untitled

a guest
May 27th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var path = document.querySelector('path');
  2. var length = path.getTotalLength();
  3. // Clear any previous transition
  4. path.style.transition = path.style.WebkitTransition =
  5. 'none';
  6. // Set up the starting positions
  7. path.style.strokeDasharray = length + ' ' + length;
  8. path.style.strokeDashoffset = length;
  9. // Trigger a layout so styles are calculated & the browser
  10. // picks up the starting position before animating
  11. path.getBoundingClientRect();
  12. // Define our transition
  13. path.style.transition = path.style.WebkitTransition =
  14. 'stroke-dashoffset 30s ease';
  15. // Go!
  16. path.style.strokeDashoffset = '0';
Add Comment
Please, Sign In to add comment