gallery5_column2.html
来自「Ajax tutorial archive」· HTML 代码 · 共 34 行
HTML
34 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Introduction to Ajax Tutorial
</title>
</head>
<body>
<p class="main">
That's the basic logic for a preload routine. You may
have noticed on the readystate == 3 branch that we are
calling a function named setOpacity(). We do this to ensure
that the image opacity is set to 0 before it is rendered by
the browser after the readyState == 4 branch has been parsed.
The function it hooks into enables us to set opacity for the
browsers that support it. Opera will simply just display the
images without using opacity. The setOpacity() function looks
like this:
</p>
<p class="code">
function setOpacity(opacity, id)<br />
{<br />
var el = document.getElementById(id).style;<br />
el.opacity = (opacity / 100);<br />
el.MozOpacity = (opacity / 100);<br />
el.KhtmlOpacity = (opacity / 100);<br />
el.filter = "alpha(opacity=" + opacity +
")";<br />
}
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?