我有代码在按钮单击时淡入淡出,但我希望在文本加载时它应该淡入或淡出如何执行此操作而不是单击按钮
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fading JavaScript Example</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="wrapper">
<div id="fade">Fading JavaScript Example</div>
<div id="buttons">
<div class="button" onclick="fadeEffect.init('fade', 1)">Fade In</div>
<div class="button floatright" onclick="fadeEffect.init('fade', 0)">Fade Out</div>
</div>
<p>For more information visit <a href="http://www.leigeber.com">leigeber.com</a>. </p>
</div>
</body>
</html>