由于某种原因,此动画无法正常工作。我希望它看起来像http://tympanus.net/Tutorials/TypographyEffects/index6.html我不明白为什么它不能正常工作。在不相关的说明中,我还设置了黑色背景色,因为我的背景图像有时不太好用。我不确定为什么。谢谢!代码是
body {
background-image: url('http://images.fanpop.com/images/image_uploads/SNL-Wallpaper-saturday-night-live-784022_1024_768.jpg');
background-size: cover;
background: #000;
}
.letter-container h2 a{
text-align: justify;
float: right;
margin-right: 100px;
font-size: 130px;
line-height: 160px;
display: block;
padding-bottom: 30px;
color: #fff;
cursor:default;
text-decoration: none;
}
.letter-container h2 a span {
color: #000;
opacity: 1;
text-decoration: none;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
transition: all 0.3s linear;
-webkit-animation: sharpen 0.9s linear backwards;
-moz-animation: sharpen 0.9s linear backwards;
-ms-animation: sharpen 0.9s linear backwards;
animation: sharpen 0.9s linear backwards;
}
.letter-container h2 a span:nth-child(1) {
animation-delay: 0s;
}
.letter-container h2 a span:nth-child(2) {
animation-delay: 0.1s;
}
我只放了几个 :nth 孩子,因为我不想填满这个职位。
@keyframes sharpen {
0% {
opacity: 0;
text-shadow: 0px 0px 100px #fff;
color: transparent;
}
90% {
opacity: 0.9;
text-shadow: 0px 0px 10px #fff;
color: transparent;
}
100% {
color: #fff;
opacity: 1;
text-shadow: 0px 0px 2px #fff, 1px 1px 4px rgba(0,0,0,0.7);
}
}
(我也有每个网络版本的关键帧) html 和 Javascript 是
<div id="letter-container" class="letter-container">
<h2><a href="#">Saturday <br/> Night <br/> Live</a></h2>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("#letter-container h2 a").lettering();
});
</script>
编辑:要在网站上查看它是http://spencedesign.netau.net/SNL/SNL.html我不明白这怎么做。是的,我确实添加了 jquery 字母