ch12_q1.htm

来自「javascript source code part1」· HTM 代码 · 共 84 行

HTM
84
字号
<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaScript>

var descriptions = new Array();
descriptions[0] = "<P>See what's been added to the website since your last visit</P>";
descriptions[1] = "<P>Find out more about me and this website</P>";
descriptions[2] = "<P>Check out the interesting and useful links on this page</P>";

function showDescription(descriptionIndex)
{
	if (document.all)
	{
		DescriptionDiv.style.visibility = "visible";
		DescriptionDiv.innerHTML = descriptions[descriptionIndex];
	}
	else
	{
		document.DescriptionDiv.visibility = "visible";
		document.DescriptionDiv.document.open();
		document.DescriptionDiv.document.write("<DIV class='DescriptionDivStyle'>");
		document.DescriptionDiv.document.write(descriptions[descriptionIndex]);
		document.DescriptionDiv.document.write("</DIV>");
		document.DescriptionDiv.document.close();
	}
}

function clearDescription()
{
	if (document.all)
	{
		DescriptionDiv.style.visibility = "hidden";
	}
	else
	{
		document.DescriptionDiv.visibility = "hidden";
	}
}
</SCRIPT>
<STYLE>

		DIV
		{
			border-width: thin;
			border-style: ridge;
			border-color: red;
			width: 250px;
			height: 70px;
			visibility: hidden;
		}

		.DescriptionDiv
		{
			position: absolute;
			left: 120px;
			top: 50px;

		}
</STYLE>

</HEAD>
<BODY>

<A href="WhatsNew.htm"
	onmouseover="showDescription(0)"
	onmouseout="clearDescription()">
	<IMG src="WhatsNew.jpg" border=0></A>
<BR>
<A href="AboutMe.htm"
	onmouseover="showDescription(1)"
	onmouseout="clearDescription()">
	<IMG src="AboutMeButton.jpg" border=0></A>
<BR>
<A href="InterestingLinks.htm"
	onmouseover="showDescription(2)"
	onmouseout="clearDescription()">
	<IMG src="InterestingLinks.jpg" border=0></A>

<DIV id=DescriptionDiv name=DescriptionDiv class="DescriptionDiv">
</DIV>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?