100分求代码?怎么样通过点击一个按钮,让页面上的一个图片旋转90度?

95306 2002-08-28 11:34:58
是这样,在页面上有一个图片,我想通过点击一个按钮,让它旋转90度,哪位帮写一下代码,100分赠送。
...全文
104 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
meizz 2002-08-28
  • 打赏
  • 举报
回复
<img id=img1 border=0 src="http://www.csdn.net/images/csdn.gif"><br>
<input type=button value=旋转90度
onclick="document.all.img1.style.filter='progid:DXImageTransform.Microsoft.BasicImage(Rotation=1)'">
孟子E章 2002-08-28
  • 打赏
  • 举报
回复
Rotation Property

--------------------------------------------------------------------------------

Sets or retrieves the value that indicates whether the content is rotated in ninety-degree increments.

Syntax

HTML N/A
Scripting object.filters.item(

"DXImageTransform.Microsoft.BasicImage").Rotation [ = iRotation ]

Possible Values

iRotation Integer that specifies or receives one of the following values: 0 Default. Content is not rotated.
1 Content is rotated 90 degrees.
2 Content is rotated 180 degrees.
3 Content is rotated 270 degrees.


The property is read/write. The property has a default value of 0.

Example

This sample sets the BasicImage filter to rotate the content of a DIV element 270 degrees.

<!-- This DIV is the target container for an image. -->
<DIV ID="oDiv" STYLE="position:absolute; left:270px;" >
An Image - >
<IMG SRC='http://www.csdn.net/images/csdn.gif' />
</DIV>
<BUTTON onclick="oDiv.style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=3)'">
Rotate 270 degrees</BUTTON><BR/>
<BUTTON onclick="oDiv.style.filter=''">Clear Filter</BUTTON><BR/>

87,996

社区成员

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

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