<script>
window.open('1.htm')
</script>
<body>
</body>1.htm:<style>
img{width:200px;height:200px;t:expression(this.ondrag=function(){move(this)})}
</style>
<script>
function move(obj)
{
window.opener.document.body.innerHTML+=(obj.outerHTML);
obj.removeNode(true);
}
</script>
<body>
<img src="1.jpg"><br>
<img src="1.gif">
</body>
window.open('1.htm')
</script>
<body>
</body>1.htm:<style>
img{width:200px;height:200px;t:expression(this.ondrag=function(){move(this)})}
</style>
<script>
function move(obj)
{
window.opener.document.body.innerHTML+=(obj.outerHTML);
obj.removeNode(true);
}
</script>
<body>
<img src="1.jpg"><br>
<img src="1.gif">
</body>
解决方案 »
- js问题
- 求一个分类选择框
- js里 文本框怎么对齐呢
- 有没有JS高亮当前菜单的方法,不想用程序控制
- 点击图片后响应的方法
- <img alt='hello' src="hello.gif"> 关于鼠标移动到图片上时弹出的"hello"这样提示,默认是一会儿就没有了的,可不可以让它一直显示啊(鼠
- 大家帮忙看看这个网址左边蓝色的那个菜单怎么做的啊,http://www.math.pku.edu.cn/index_cn_2004.asp
- 关于javaScript全选的问题?
- js里的分支语句的语法?
- 关于Wscript的学习
- DOCTYPE 声明会导致javascipt无法正常执行?????
- JS小问题,树节点的图片替换
在父页面中我要指定这个img放到某个td中,如何实现?另外在子窗口中,目前是鼠标在两个图上点击一下,然后随便在子窗口中拖动一下就反映到父窗口中了,能否做到当鼠标拖动到父窗口时,才把这个图片显示在父窗口中的对应位置上?鼠标在子窗口中移动则不做处理?
<style>
td{background-color:red;width:100px;height:100px}
</style>
<script>
window.open('1.htm')
</script>
<body>
<table>
<tr><td id='img'></td><td></td></tr>
</table>
</body>1.htm:<style>
img{width:200px;height:200px;t:expression(this.ondrag=function(){move(this)})}
</style>
<script>
function move(obj)
{
window.opener.document.getElementById('img').innerHTML+=(obj.outerHTML);
obj.removeNode(true);
}
</script>
<body>
<img src="1.jpg"><br>
<img src="1.gif">
</body>
========================>当鼠标拖动到父窗口时,IE会自动显示图片,也就是说父窗口会重定向到这个图片的url,原来的父页面不再存在,这是IE的一个特性.可以用代码检测到图片拖动到父窗口,但是无法阻止父窗口的url重定向
也就是说,我把图片放到某个div中,然后让父窗口显示这个div块?
img{width:200px;height:200px;t:expression(this.ondragend=function(){move(this)})}
#movePic{width:200px;height:200px;background-color:red}
</style>
<script>
function move(obj)
{
if(document.elementFromPoint(event.clientX,event.clientY).id=='movePic')
{
window.opener.document.getElementById('img').innerHTML+=(obj.outerHTML);
obj.removeNode(true);
}
}
</script>
<body>
<img src="1.jpg"><br>
<img src="1.gif">
<div id="movePic"></div>
</body>