請問怎樣在顯示的一幅圖片上增加放大縮小的功能

mycl3344 2003-10-09 10:15:01
我想在顯示的一幅圖片的增加放大和縮小的功能﹐請問能夠實現嗎?
有沒有這方面的原代碼?
...全文
43 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
iinohk 2003-10-09
  • 打赏
  • 举报
回复
有兩個方法
1)
<img src="xxx" style="width:20px;height:20px" name=imga>
<input type=text name=imgwidth>
<input type=text name=imgheight>
<input type=button onclick="change()">
<script>
function change(){
with(document.all){
imga.style.width=imgwidth.value;
imga.style.height=imgheight.value;
}
}

}
</script>

2.
<img src="xxx" style="width:20px;height:20px" name=imga>
<input type=button onclick="imga.style.zoom=imga.style.zoom-10">

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧