Apologies in advance as this is the first question I've ever posted on here so bear with me. Wondering if anyone can help, I'm not bad with HTML and CSS but have no real skill in jquery or javascript. Anyway I'm working on a customer site and have a set of unordered lists in a container div with CSS animations. It's a one page website so the animations are below the fold. What I'd like to do is delay the animations to start until they are scrolled to by the user. Cheers in advance.
Here's the mark-up:
<div id="processbox">
<ul class="process" id="pos">
<li>Generous public open spaces</li>
<li>Community orchards</li>
<li>Allotments</li>
</ul>
<ul class="process" id="community">
<li>Land for a community building</li>
<li>Sports pitches</li>
<li>Contributions towards community projects</li>
</ul>
<ul class="process" id="traffic">
<li>Traffic calming</li>
<li>Safe routes to school</li>
</ul>
<ul class="process" id="water">
<li>Sustainable surface water drainage</li>
<li>Flood prevention</li>
</ul>
</div>
And the CSS:
.process {
background-color: #3d323e;
color: #efe8dd;
max-width: 698px;
padding-top: 20px;
padding-left: 35px;
padding-right: 30px;
padding-bottom: 20px;
margin-bottom: 10px;
}
#pos.process {
min-height: 60px;
-webkit-animation-name: fullwidth;
-moz-animation-name: fullwidth;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-timing-function: ease;
-moz-animation-timing-function: ease;
}
#community.process {
min-height: 60px;
-webkit-animation-name: fullwidth;
-moz-animation-name: fullwidth;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-timing-function: ease;
-moz-animation-timing-function: ease;
animation-delay:0.25s;
-webkit-animation-delay:0.25s;
}
#traffic.process {
min-height: 60px;
-webkit-animation-name: fullwidth;
-moz-animation-name: fullwidth;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-timing-function: ease;
-moz-animation-timing-function: ease;
animation-delay:0.5s;
-webkit-animation-delay:0.5s;
}
#water.process {
min-height: 60px;
margin-bottom: 0px;
-webkit-animation-name: fullwidth;
-moz-animation-name: fullwidth;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-iteration-count: 1;
-webkit-animation-timing-function: ease;
-moz-animation-timing-function: ease;
animation-delay:0.75s;
-webkit-animation-delay:0.75s;
}
@-webkit-keyframes fullwidth {
0% {
width: 0;
opacity: 0.5;
width: 10%;
}
90% {
width: 105%;
}
100% {
width: 100%;
opacity: 1;
}
}
@-moz-keyframes fullwidth {
0% {
width: 0;
opacity: 0.5;
width: 10%;
}
90% {
width: 105%;
}
100% {
width: 100%;
opacity: 1;
}
}