怎样控制图片可以成比例缩小?

wenxiuyun 2004-04-09 03:48:36
请提供?
...全文
73 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhanghao5188 2004-04-12
  • 打赏
  • 举报
回复

<script language="JavaScript1.2">

function expand() {
if (smallslot.width<=102) {
x=window.setTimeout('expand()', 10)
smallslot.width=smallslot.width + 15
smallslot.height=smallslot.height + 15
}
else {
setTimeout('reduce()', 0)
}
}

function reduce() {
if (smallslot.width>80) {
x=window.setTimeout('reduce()', 10)
smallslot.width=smallslot.width - 15
smallslot.height=smallslot.height - 15
}
}
</script>


将下面的原代码加入<body></body>之间

<div id="slot1" onmouseover="expand()" style="HEIGHT: 102px; WIDTH: 80px"><a href="http://netschool.myweb.com.cn/" target="_top">
<dd><img border="0" hspace="0" id="smallslot" src="ajie.gif" style="LEFT: 296px; POSITION: absolute; TOP: 104px; VISIBILITY: visible; z: 2" WIDTH="80" HEIGHT="102"></a> </dd>
</div>

 

swordman123 2004-04-11
  • 打赏
  • 举报
回复
<img border="0" src="tjqy\<%=Rs("picture")%>" align="center" onload="javascript:KeyDown();">
mynamelj 2004-04-10
  • 打赏
  • 举报
回复
关注
wenxiuyun 2004-04-09
  • 打赏
  • 举报
回复
这些代码该放在哪里?
sfply 2004-04-09
  • 打赏
  • 举报
回复
function KeyDown()
{
if (window.event.keyCode==39)
{
img1.width=img1.width+img1.width/10;
img1.height=img1.height+img1.height/10;
event.returnValue=false;
}
if (window.event.keyCode==40)
{
img1.width=img1.width-img1.width/10;
img1.height=img1.height-img1.height/10;
event.returnValue=false;
}
}


上面是用上健控制缩放大小

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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