Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/478.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 带背景图像的jQuery fadeIn_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 带背景图像的jQuery fadeIn

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

我正在使用jQuery淡入我的主页,但它目前正在从白色淡入。有没有办法从黑色页面淡入?这与加载iframe时的情况相同,它会闪烁白色。我知道这是可以修复的,所以我想这可能也有修复方法

CSS:

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);
})

还没有测试过,但可以为您工作:)

它只做同样的事情,带有白色闪光灯。