哈,前些天有人问过类似问题!
L@_@K
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<div style="width: 300px; height: 1500px; background-color: blue;">
</div>
<A onClick="Click_Func(img);return false;" href="#"> see demo </A> <br>
<img id="img" src="images2/111.png" alt="" style="DISPLAY: none; VERTICAL-ALIGN: middle">
<script language="javascript" type="text/javascript">
function Click_Func(objID) //显示一个图片
{
var obj=objID;
if(obj.style.display=="none")
obj.style.display="block";
else
obj.style.display="none";
}
</script>
</body>
</html>
L@_@K
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<div style="width: 300px; height: 1500px; background-color: blue;">
</div>
<A onClick="Click_Func(img);return false;" href="#"> see demo </A> <br>
<img id="img" src="images2/111.png" alt="" style="DISPLAY: none; VERTICAL-ALIGN: middle">
<script language="javascript" type="text/javascript">
function Click_Func(objID) //显示一个图片
{
var obj=objID;
if(obj.style.display=="none")
obj.style.display="block";
else
obj.style.display="none";
}
</script>
</body>
</html>
function Click_Func(objID) //显示一个图片
{
var obj=objID;
if(obj.style.display=="none")
obj.style.display="block";
else
obj.style.display="none";
document.body.scrollTop = document.body.scrollHeight - document.body.clientHeight;
}
</script>