100分求旋转90度接下来的问题?

95306 2002-08-28 03:55:16
根据秋水的代码,可以实现点击一个按钮,把一个层旋转90度,现在如果页面上有两个或多个层,当我点击一个层的时候,再点击按钮,就把当前层旋转90度,这个又该如何实现??
...全文
28 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
95306 2002-08-28
  • 打赏
  • 举报
回复
非常感谢,给分
qiushuiwuhen 2002-08-28
  • 打赏
  • 举报
回复
<div id="Layer1" onclick=div=this style="position:absolute; left:99px; top:51px; width:30px; height:59px; z-index:1; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000"></div>
<div id="Layer2" onclick=div=this style="position:absolute; left:139px; top:52px; width:30px; height:59px; z-index:1; background-color: #0000FF; layer-background-color: #0000FF; border: 1px none #000000"></div>
<div id="Layer3" onclick=div=this style="position:absolute; left:178px; top:53px; width:30px; height:59px; z-index:1; background-color: #FFFF00; layer-background-color: #FFFF00; border: 1px none #000000"></div>

<input type="button" onclick="try{div.style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)'}catch(e){alert('你还没选择')} " name="button" value="Button">
qiushuiwuhen 2002-08-28
  • 打赏
  • 举报
回复
<div id="Layer1" onclick=div=this style="position:absolute; left:99px; top:51px; width:30px; height:59px; z-index:1; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000"></div>
<div id="Layer2" onclick=div=this style="position:absolute; left:139px; top:52px; width:30px; height:59px; z-index:1; background-color: #0000FF; layer-background-color: #0000FF; border: 1px none #000000"></div>
<div id="Layer3" onclick=div=this style="position:absolute; left:178px; top:53px; width:30px; height:59px; z-index:1; background-color: #FFFF00; layer-background-color: #FFFF00; border: 1px none #000000"></div>

<input type="button" onclick="if(div)div.style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)' " name="button" value="Button">
95306 2002-08-28
  • 打赏
  • 举报
回复
代码如下:怎么做才能用一个按钮来旋转层,不是一起旋转,是当我点那个层,再点按钮,这个层旋转90度,明确的说就是我想让哪个旋转哪个就旋转,不知我说明白了没有。
<div id="Layer1" style="position:absolute; left:99px; top:51px; width:30px; height:59px; z-index:1; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000"></div><div id="Layer2" style="position:absolute; left:139px; top:52px; width:30px; height:59px; z-index:1; background-color: #0000FF; layer-background-color: #0000FF; border: 1px none #000000"></div><div id="Layer3" style="position:absolute; left:178px; top:53px; width:30px; height:59px; z-index:1; background-color: #FFFF00; layer-background-color: #FFFF00; border: 1px none #000000"></div><input type="button" onclick="Layer1.style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)' " name="button" value="Button">
方工 2002-08-28
  • 打赏
  • 举报
回复
IE6.0 win98 no problem
95306 2002-08-28
  • 打赏
  • 举报
回复
秋水再看看,好像有问题
孟子E章 2002-08-28
  • 打赏
  • 举报
回复
function t(Divid)
{
document.all[Divid].style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)'

}
qiushuiwuhen 2002-08-28
  • 打赏
  • 举报
回复
<style>
.b {FILTER: progid:DXImageTransform.Microsoft.BasicImage(Rotation=0);BACKGROUND-COLOR: #EEEEEE;width:100px;height:100px}
</style>
div1
<div id=demo class=b>hehe</div>
div2
<div class=b>hehe</div>
div3
<div class=b>hehe</div>


<script>
function document.onclick(){
var e=window.event.srcElement
if(e.className=="b")with(e.filters[0])Rotation=(Rotation+1)%4
}
</script>
孟子E章 2002-08-28
  • 打赏
  • 举报
回复
层的Id做参数啊
方工 2002-08-28
  • 打赏
  • 举报
回复
我来学习学习,秋水的代码在哪?

87,922

社区成员

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

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