简体   繁体   English

滚动到CSS动画后锚定吗?

[英]Scroll to anchor after CSS animation?

I have an CSS animation like this: 我有这样的CSS动画:

@-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? 我对jQuery或JavaScript没有真正的经验,所以您能帮帮我吗?

See the site: HERE 请参阅网站: 此处

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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