为着陆页设置动画文字

时间:2016-11-24 08:49:13

标签: html css html5 css-animations

有没有办法可以在登录页面上用html轻松实现这种类型的动画文字

Image

1 个答案:

答案 0 :(得分:3)

是的,有:)



var messages = ["Be", "Up to Speed", "Up to", "Up"],
    counter = 0,
    target = document.getElementById("message");

setInterval(function(){ 
  
  target.innerHTML = messages[counter];
  counter++;
  
  if( counter >= messages.length ) {
    counter = 0;
  }

}, 300);

body {
  font: bold 1em sans-serif;
}
#message {
  box-shadow: .125em 0 0 0 rgba(128,128,128,.3);
  color: MediumAquamarine;
  padding-right: .125em;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<h1>You too can... <span id="message"></span></h1>
&#13;
&#13;
&#13;