简体   繁体   中英

Scroll to anchor after CSS animation?

I have an CSS animation like this:

@-webkit-keyframes flip {
0% {opacity:1;}
100% {opacity: 0;} //This could be 90%
//And here could be frame for 100% which would scroll it down.
}

#headercover {
    -webkit-animation-name:flip;
-webkit-animation-duration:3s;
-webkit-animation-timing-function:ease;
-webkit-animation-delay:1s;
-webkit-animation-iteration-count:1;
-webkit-animation-play-state:running;
-webkit-animation-fill-mode: forwards;

I'd want the page to scroll down to an anchor, after the last frame of the animation. I'm not really experienced in jQuery or JavaScript, so could you help me out?

See the site: HERE

setTimeout(function(){
    $('html, body').animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
}, 3000); // wait 3000 ms 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM