簡體   English   中英

滾動到CSS動畫后錨定嗎?

[英]Scroll to anchor after CSS animation?

我有這樣的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;

我希望頁面在動畫的最后一幀之后向下滾動到錨點。 我對jQuery或JavaScript沒有真正的經驗,所以您能幫幫我嗎?

請參閱網站: 此處

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