Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Starting animation only when scrolled to container

$
0
0

There is a good article about that.http://www.raymondcamden.com/2013/12/6/Delaying-an-Edge-Animate-asset-until-visible--Part- 4.

 

// insert code to be run when the symbol is created here
var wasHidden = true;    //http://stackoverflow.com/a/488073/52160    function isScrolledIntoView(elem) {        var docViewTop = $(window.parent).scrollTop();        var docViewBottom = docViewTop + $(window.parent).height();        var elemTop = $(elem).offset().top;        var elemBottom = elemTop + $(elem).height();        return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)          && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop) );    }             var element = sym.element;    element = $("#graphics", window.parent.document);    if(isScrolledIntoView(element)) {        console.log('on load vis');        wasHidden=false;        sym.play();    }    function doStart() {        if(isScrolledIntoView(element)) {            if(wasHidden) {                console.log('Start me up ID5');                   sym.play();            }            wasHidden = false;        } else {            sym.stop();            wasHidden = true;        }    }    $(window.parent).on("scroll", doStart);

 

But the problem is this code doesn't work with Edge Animate CC 2014.

Are there any ideas how to adapt the code for newest version of Edge Animate?

Thanks.


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>