Javascript 带背景图像的jQuery fadeIn
我正在使用jQuery淡入我的主页,但它目前正在从白色淡入。有没有办法从黑色页面淡入?这与加载iframe时的情况相同,它会闪烁白色。我知道这是可以修复的,所以我想这可能也有修复方法 CSS:Javascript 带背景图像的jQuery fadeIn,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我正在使用jQuery淡入我的主页,但它目前正在从白色淡入。有没有办法从黑色页面淡入?这与加载iframe时的情况相同,它会闪烁白色。我知道这是可以修复的,所以我想这可能也有修复方法 CSS: html { background: black url(images/bg.jpg) no-repeat 200px center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o
html {
background: black url(images/bg.jpg) no-repeat 200px center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
display: none;
}
body {
margin: 0;
height: 100%;
padding-left: 40px;
padding-top: 25px;
}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="home.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$('html').fadeIn(3000);
})
</script>
</head>
<body>
</body>
</html>
脚本:
html {
background: black url(images/bg.jpg) no-repeat 200px center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
display: none;
}
body {
margin: 0;
height: 100%;
padding-left: 40px;
padding-top: 25px;
}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="home.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$('html').fadeIn(3000);
})
</script>
</head>
<body>
</body>
</html>
$(文档).ready(函数(){
$('html').fadeIn(3000);
})
是,尝试将
更改为
<body><div id="page">Content here</div></body>
和Javascript
$(document).ready(function(){
$('#page').fadeIn(3000);
})
还没有测试过,但可以为您工作:)它只做同样的事情,带有白色闪光灯。