很抱歉发了这么短的帖子,但我需要一些帮助来创造这个网站上显示的效果:
http://joelfilipe.com/
基本上,我知道你可以用jQuery做一个"fadeIn“,但我不确定如何在网站上实现3d效果,因为它看起来像是降落在页面上,我试图深入研究代码和视图,但我相当困惑。任何帮助或建议都将不胜感激。谢谢。
发布于 2016-05-27 06:03:13
这不需要使用javascript,只需使用CSS即可完成,如下所示。
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300);
body {padding: 0; margin: 0; background-color: #333;}
.container {position: fixed; top: 25%; left: 25%;}
/* make keyframes that tell the start state and the end state of our object */
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.fade-in {
opacity:0; /* make things invisible upon start */
-webkit-animation:fadeIn ease-in 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */
-moz-animation:fadeIn ease-in 1;
animation:fadeIn ease-in 1;
-webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
animation-duration:1s;
}
.fade-in.one {
-webkit-animation-delay: 0.7s;
-moz-animation-delay: 0.7s;
animation-delay: 0.7s;
}
.fade-in.two {
-webkit-animation-delay: 1.2s;
-moz-animation-delay:1.2s;
animation-delay: 1.2s;
}
.fade-in.three {
-webkit-animation-delay: 1.6s;
-moz-animation-delay: 1.6s;
animation-delay: 1.6s;
}
/*---make a basic box ---*/
.box{
width: 200px;
height: 200px;
position: relative;
margin: 10px;
float: left;
border: 1px solid #333;
background: #999;
}<div class="container">
<div class="box fade-in one">
look at me fade in
</div>
<div class="box fade-in two">
Oh hi! i can fade too!
</div>
<div class="box fade-in three">
Oh hi! i can fade three!
</div>
</div>
或者,您可以使用javascript来激活CSS动画。您可以在这里看到一个类似的示例http://www.virginholidays.co.uk/wonderlist
发布于 2016-05-27 06:07:57
你可以使用wow effects这是一个完整的库来创建css动画
你可以使用数据-哇-持续时间数据-哇-延迟下载css和js文件,你很快就可以上路了。
https://stackoverflow.com/questions/37471610
复制相似问题