div+css怎么设置层可以拖动的效果

div+css怎么设置层可以拖动的效果,第1张

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" ">通常这功能都是直接丢给程序员做的,设计只需要做好静态的就行了
直接给你链接,你参考着做
><html>
<head>
<script language=javascript>
function imgMove()
{
//if the left button was not pressed,return
if(windoweventbutton!= 1)
{
return 0;
}
//get the new position
with(windoweventsrcElementstyle)
{
pixelLeft = windoweventx-236/2-documentallimgDivoffsetLeft;
pixelTop = windoweventy-118/2-documentallimgDivoffsetTop;
}
windoweventreturnValue=false;
}
</script>
</head>
<body>
<div Style="position:relative" ID="imgDiv">
<img src="20080105039jpg" id="img2" Style="CONTAINER:positioned;position:absolute;
top:60px;left:60px;236px;height:118px;" onMouseMove=imgMove()>
</div>
</body>
</html>
你把<img src="20080105039jpg" id="img2" 换成你的就OK了


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/13372292.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-23
下一篇 2023-07-23

发表评论

登录后才能评论

评论列表(0条)

保存