如何通过单击按钮启动css动画

时间:2015-06-21 07:28:15

标签: html css button

嗨,任何人都可以帮我解决这个小事,我不知道怎么做但我想在启动时点击按钮而不是自动启动动画。

h2 {
	font-size: 20px;
	animation: blurFadeInOut 3s ease-in backwards;
  }
h3 {
  font-size: 20px;
	animation: blurFadeIn 3s ease-in backwards;
}
h2, h3 {
 position: absolute;
  top: 0;
  height: 100%;
  margin-top: 0;
  width: 100%;
  margin-left: 0;
  line-height: 69px;
  text-align: center;
  font-family: "Cedarville Cursive";
  color: black;
}

h2.frame-6, h3.frame-1 {
  -webkit-animation-delay: 0s;
          animation-delay: 0s;
  }
h2.frame-7, h3.frame-1 {
  -webkit-animation-delay: 11s;
          animation-delay: 11s;
  }
h2.frame-1, h3.frame-1 {
  -webkit-animation-delay: 14s;
          animation-delay: 14s;
}
h2.frame-2, h3.frame-2 {
  -webkit-animation-delay: 17s;
          animation-delay: 17s;
}
h2.frame-3, h3.frame-3 {
  -webkit-animation-delay: 20s;
          animation-delay: 20s;
}
h2.frame-4, h3.frame-4 {
  -webkit-animation-delay: 23s;
          animation-delay: 23s;
}
h2.frame-5, h3.frame-5 {
  -webkit-animation: none;
          animation: none;
}
h2.frame-5 span, h3.frame-5 span {
  -webkit-animation: blurFadeIn 2s ease-in 12s backwards;
          animation: blurFadeIn 2s ease-in 12s backwards;
  color: transparent;
  text-shadow: 0px 0px 1px #fff;
}

@-webkit-keyframes blurFadeInOut{
	0%{
		opacity: 0;
		text-shadow: 0px 0px 40px #fff;
		transform: scale(1.3);
	}
	20%,75%{
		opacity: 1;
		text-shadow: 0px 0px 1px #fff;
		transform: scale(1);
	}
	100%{
		opacity: 0;
		text-shadow: 0px 0px 50px #fff;
		transform: scale(0);
	}
}

@-webkit-keyframes blurFadeIn{
	0%{
		opacity: 0;
		text-shadow: 0px 0px 40px #fff;
		transform: scale(1.3);
	}
	50%{
		opacity: 0.5;
		text-shadow: 0px 0px 10px #fff;
		transform: scale(1.1);
	}
	100%{
		opacity: 1;
		text-shadow: 0px 0px 1px #fff;
		transform: scale(1);
	}
}


enter code here
 <center><h2 class='frame-6'>Because today is a special day, sending birthday wishes simply wouldn&#8217;t do, so I&#8217;m sending you a day when all of your dreams come true, and a year that means the most to you!</h2></center>
 <center><h2 class='frame-7'>Let&#39;s sing together!</h2></center>
    <center><h2 class='frame-1'>Happy Birthday Too You</h2></center>
  <center>  <h2 class='frame-2'>Happy Birthday Too You</h2></center>
 <center> <h2 class='frame-3'>Happy Birthday Dear Demo</h2></center>
 <center> <h2 class='frame-4'>Happy Birthday Toooo Youuuu</h2></center>
    <h3 class='frame-5'><span><h2 class='frame-3'>Wish You A Verry Happy Birthday Demo </h2></span></h3>

0 个答案:

没有答案