js拖拽图片 有两个DIV,其中一个DIV有图片,如何通过JS实现,把图片拖拽(复制)至另一个DIV中?一定要是鼠标拖拽 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD><script language="javascript">function moveImage(){ if(window.event.button!=1){return;} with(window.event.srcElement.style){//重新设置图像在浏览器中的位置 pixelLeft=window.event.x-236/2-document.getElementById("ImageDiv").offsetLeft; pixelTop=window.event.y-108/2-document.getElementById("ImageDiv").offsetTop; } window.event.returnValue=false;//取消系统拖动事件}</script> </HEAD> <BODY> <div style="position:relative" id="ImageDiv"> <img id="image2" style="container:positioned;position:absolute;top:60px;left:250px;width:236px;height:108px;" src="img/11.jpg"> <img id="image2" style="container:positioned;position:absolute;top:60px;left:60px;width:236px;height:108px;" src="img/22.jpg" onmousemove=moveImage()> </div> </BODY></HTML> 关于jquery的ajax跨域问题 javascript 基本问题 【求助】一个关于JS+Flash广告代码不能显示的问题 怎样提取<a>要提取的内容</a> web.51.la是什么东西 请教一个关于ligthbox的问题! 关于typeof的问题 奇怪的问题,问了很多高手都搞不定? 在本页面中如何设置自己的toolbar隐藏掉? js写法和jquery on绑定事件的问题 |zyciis| 当Jquery.ui.datepicker用$(this).datepicker();的方法显示的时候,第一次焦点不显示,第二次才显示,为什么 不熟悉jquery,麻烦高手帮助完善一个函数
<HTML>
<HEAD>
<script language="javascript">
function moveImage(){
if(window.event.button!=1){return;} with(window.event.srcElement.style){
//重新设置图像在浏览器中的位置
pixelLeft=window.event.x-236/2-document.getElementById("ImageDiv").offsetLeft;
pixelTop=window.event.y-108/2-document.getElementById("ImageDiv").offsetTop;
}
window.event.returnValue=false;//取消系统拖动事件
}
</script>
</HEAD> <BODY>
<div style="position:relative" id="ImageDiv">
<img id="image2" style="container:positioned;position:absolute;top:60px;left:250px;width:236px;height:108px;" src="img/11.jpg">
<img id="image2" style="container:positioned;position:absolute;top:60px;left:60px;width:236px;height:108px;" src="img/22.jpg" onmousemove=moveImage()>
</div>
</BODY>
</HTML>