I am creating a 'limited' visual builder for Skrollr sliders. It allows the user to build sliders that consist of slides (html section
tags) that sit one below each other on the page, each slide contains many html elements that have Skrollr data attributes/animations (keyframes?) applied to them.
Is there a way to pause that slides (advancement to the next slide) until all its inner elements have completed their animations?
I am aware of the example pausing.html
that demonstrates kindof what I need but these 'slides' are fixed which could cause problems for my users. The sliders will be chucked into WordPress website themes where most elements are not fixed.
Because the slide contents are so dynamic and unpredictable its hard to know how long to lock scrolling? Hopefully its possible to do this?
Example of my dilemma:
.... Some regular WordPress page content (Navbar, Header maybe posts, etc.)
<div id="skrollr-body">
// Pause this slides scrolling till all child elements have completed their animations
// Slide child elements will ALWAYS have relative animations (data-100-top="..." NOT data-100="...")
<section id="slide-1" class="slide">
<p data-center="opacity: 1;" data-top="opacity: 0;">Some awesomeness</p>
<img data--100-center="transform: translate(-100%,0);" data-top="transform: translate(0,0);" src="..."/>
... lots of other elements
</section>
<section id="slide-2" class="slide">
...
</section>
<section id="slide-3" class="slide">
...
</section>
</div>
.... Some regular WordPress page content (Footer, maybe posts, etc.)
Disable the next button till the animation complete, you can enable after CSS animation complete. Here is an article explaining how to track CSS animation callback.
Please refer to the following resources:
.promise()
and$.when
index.html
I forgot there's additional modifications to
_main.js
, they annotated with a ✓:_main.js