Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(
- function JsonAnimation(DivIdAndPath) { animContainer = document.getElementById(DivIdAndPath); /*id of div animation is draw in*/
- var contentAnimation = {
- container: animContainer,
- renderer: 'svg',
- loop: true,
- autoplay:false,
- autoloadSegments: false,
- path: '/wp-content/json/DivIdAndPath.json'// path to your data.json file you rendered from AE
- };
- var anim;
- anim = bodymovin.loadAnimation(contentAnimation );
- animContainer.addEventListener("mouseover", playAnim);
- animContainer.addEventListener("mouseleave", stopAnim);
- function playAnim(){ anim.play(); }
- function stopAnim(){ anim.stop(); }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement