我为我的bootstrap网站添加了页面加载GIF图标,但我有一个小问题,这个图像加载器加载非常快,我需要为这个加载器设置持续时间,我添加duration
但它不是工作,我该如何解决?
感谢
$(window).load(function() {
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");
;
});
no-js #loader { display: none; }
.js #loader { display: block; position: absolute; left: 100px; top: 0; }
.se-pre-con {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background:url("https://thumb.ibb.co/hqtTTk/Preloader_2.gif" )center no-repeat #fff;
}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js"></script>
<body>
<div class="se-pre-con"></div>
</body>
答案 0 :(得分:1)
试试这个:
setTimeout(function(){ $(".se-pre-con").fadeOut("slow"); }, 3000);