当前位置导航:炫浪网>>网络学院>>网页制作>>ASP教程

几个对图形进行动态处理的dhtml代码

  1)<html>
<head>

<script language="JavaScript">
function setHeight()
{
var x=document.images
x[0].height="250"
}
</script>

</head>
<body>

<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121000561964730.gif?http://www.xvna.com"" width="107" height="98" />

<form>
<input type="button" onclick="setHeight()" value="Change height">
</form>

</body>
</html>

2)<html>
<head>

<script language="JavaScript">
function setSrc()
{
var x=document.images
x[0].src="/Files/BeyondPic/jcwcj/2005-12/10/05121000561956444.gif?http://www.xvna.com""
}
</script>

</head>
<body>

<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121000561964730.gif?http://www.xvna.com"" width="107" height="98" />

<form>
<input type="button" onclick="setSrc()" value="Change image">
</form>

</body>
</html>
3)<html>
<head>

<script language="JavaScript">
function setWidth()
{
var x=document.images
x[0].width="300"
}
</script>

</head>
<body>

<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121000561964730.gif?http://www.xvna.com"" width="107" height="98" />

<form>
<input type="button" onclick="setWidth()" value="Change width">
</form>

</body>
</html>

注意,图形文件换成自己的文件,试试,不错吧 
相关内容
赞助商链接