98、用按钮缩放图片

98、用按钮缩放图片

脚本说明:

把如下代码加入<body>区域中

<input type="button" value="缩小" onclick="small1()">

<input type="button" value="放大" onclick="big1()"><BR>

<img border="0"  name=images1 src="0005.jpg" width="74" height="125">

<script>

function small(){

var height1=images0.height

var width1=images0.width

images0.height=height1/1.5

images0.width=width1/1.5}

 

function big(){

var height1=images0.height

var width1=images0.width

images0.height=height1*1.5

images0.width=width1*1.5}

 

function small1(){

var height1=images1.height

var width1=images1.width

images1.height=height1/1.5

images1.width=width1/1.5}

 

function big1(){

var height1=images1.height

var width1=images1.width

images1.height=height1*1.5

images1.width=width1*1.5}

</script>

Write a comment

Comments: 0