If there is no API for this kind of behaviour within the template, my guess would be that it is going to be very tricky.
You probably need to get the full height of the page and do a check where the user is at any point during his visit and adjust the time of the animation based on that position (relative to the total height).
The challenge is going to be:
- how 'deep' is your banner in terms of iframe in iframe in iframe in iframe, etc
- how accessible is the page information from within your iframe
- where and how is the banner position based on the page (also taking into account responsiveness)
Tricky tricky. I'm sorry I can't really help you, but I'm eager to see what other people can come up with. Is there a template we can have a look at (the template from Adtech for instance).