I have been trying to fade out a CSS3 preloader with jQuery. I have been trying to stop the animation (which is a box rotating), and then fade in a letter inside the box then, have them both fade out, the letter fading out a little later than the box. I have had the problem where the letter fades in way later than I want it to and when it comes on if fades out really fast. Here is the code:

我一直试图用jQuery淡出CSS3预加载器。我一直试图阻止动画(这是一个旋转的盒子),然后在框内淡入一个字母,然后让它们都淡出,字母比盒子晚一点淡出。我遇到了这样一个问题,即字母会比我想要的更晚消失,如果它出现的话,如果消失得非常快。这是代码:

	//<![CDATA[
$(window).load(function() { // makes sure the whole site is loaded
$('.loader-inner').css({'-webkit-animation': 'none'});
$('.loader').delay(100).css({'-webkit-animation': 'none'}); // will first fade out the loading animation
$('.letter').delay(100).fadeIn('slow'); 
$('.preloader').delay(2050).fadeOut('slow');// will fade out the white DIV that covers the website.
$('.letter').delay(2060).fadeOut(900);
$('body').delay(2060).css({'overflow':'visible'});
		});
	//]]>
body, html {
    height: 100%;
    text-align: center;
}

body {
  background-color: #2f2f2f;
  }
.preloader {
 position: fixed;
 

 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 z-index: 99999;
 background-color: #2f2f2f;
}

.loader {
  display: block;
  width: 60px;
  height: 60px;
  position: fixed;
  border: 5px solid #d5b317;
  top: 50%;
  left:50%;
  -webkit-animation: loader 2s infinite ease;
  z-index: -10;
  overflow: hidden;
  margin-left: -29px
}

.loader-inner {
  vertical-align: top;
  display: inline-block;
  width: 100%;
  background-color: #d5b317;
  -webkit-animation: loader-inner 2s infinite ease-in;
  z-index: -10;
}
@font-face {
    font-family: 'Adobe Gurmukhi';
    src: url(/fonts/AdobeGurmukhi-Regular.ttf);
}

.letter {
 display:hidden;
 color: #f7d11e;
 font-family: 'Adobe Gurmukhi';
 font-size: 70px;
 position:absolute;  
 top: 50%;
 left: 50%;
 margin-top: -17px;
 margin-left: -19px;
 z-index: -9;

}
@-webkit-keyframes loader {
  0% {
    transform: rotate(0deg);
  }
  
  25% {
    transform: rotate(180deg);
  }
  
  50% {
    transform: rotate(180deg);
  }
  
  75% {
    transform: rotate(360deg);
  }
  
  100% {
    transform: rotate(360deg);
  }
}

@-webkit-keyframes loader-inner {
  0% {
    height: 0%;
  }
  
  25% {
    height: 0%;
  }
  
  50% {
    height: 100%;
  }
  
  75% {
    height: 100%;
  }
  
  100% {
    height: 0%;
  }
}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js">
      </script>
<!--preloader-->
 <div class="preloader">
   <span class="loader"><span class="loader-inner"></span></span>
     </div>
    <span><p class="letter">ਅ</p></span>

更多相关文章

  1. php实现完整版验证码(数字+大小写字母+干扰素)
  2. 仅在我的文本框中验证数字和字母
  3. jsPDF中使用.text()方法的字母间距
  4. [python]如何将26个字母随意进行组合,返回值得位数为2-4位。
  5. sqlserver2008r2查找非中文字母数字出现的第一个位置
  6. 744.寻找比目标字母大的最小字母(Find Smallest Letter Greater
  7. Java区分大小写字母数字和符号
  8. java 正则表达式查找某段字符串中所有小写字母开头的单词并统计
  9. java 中判断一个字符串中大小写字母的个数及其思路

随机推荐

  1. Android/IOS手机使用Fiddler抓包
  2. Android测试驱动开发实践1
  3. Android(安卓)studio gradle build 太慢,
  4. android项目中每个文件的作用
  5. 也谈Android的学习和利用Android来赚钱
  6. 格式化字符串android 格式化时间
  7. Android声明和使用权限
  8. Android的5层平台架构
  9. Android中图片Bitmap的缩放
  10. Android常用布局