CSS:
div.fade_in { display: none; }
您可以使其在页面加载时淡入:
$(function() {
$("div.fade_in").fadeIn();
});
如果要等待鼠标移动:
function fade_in() {
$("div.fade_in").fadeIn();
$("html").unbind("mousemove", fade_in);
}
$("html").mousemove(fade_in);
编辑:在 IE8(兼容模式)、FF3.5 和 Chrome 3 中测试:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://mageia.rh.rit.edu//resources/main.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
function fade_in() {
$("div.fade_in").fadeIn();
$("html").unbind("mousemove", fade_in);
}
$(function() {
$("html").mousemove(fade_in);
});
</script>
<style type="text/css">
div.fade_in { display: none; }
</style>
</head>
<body>
<h1 class="centertext">Welcome to Mageia</h1>
<h3 class="centertext">The Works of Genii</h3>
<div id = "container" class="fade_in" >
<img class="image1" src="http://mageia.rh.rit.edu/resources/Escher.gif" />
</body>
</html>