去.NET 的论坛上面问问这个问题,包准有人回答
解决方案 »
- jQuery mobile开发iPad应用,怎么调用C#写的Web Service?
- 为什么不可以在fckeditor放入完整的<object>和<embed>tag?
- 如何获取div内指定标签数,见代码
- 求JavaScript正则表达式
- 关于mapabc API使用遇到的一些问题
- QQ第三方登陆
- 弹出页时,父页回到顶部的问题
- 几个容易搞混的东西,大家给说说:Element.style.top,Element.offsetHeight style.pixelTop等等..
- 请问怎么实现象MSDN上那样树和右边的分隔栏是可以左右拖动的?
- 我是新手,有点问题?
- 如何动态使一个元件不可见
- 如何取得浏览器可视区域的大小!!!!!!
----------<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type=text/css>
div{background-color: #D6D3CE; BORDER-TOP:thin outset; BORDER-RIGHT:thin outset; BORDER-BOTTOM:thin outset; BORDER-LEFT:thin outset;width:120;visibility:hidden; POSITION: absolute;font-size:9pt;line-height:150%}
a:visited { color:#000000; text-decoration: none}
a:link { color: #000000; text-decoration: none}
a:hover { color:WHITE; text-decoration: none;background:#000000;width:120;height:18}
</style>
</head>
<body oncontextmenu=self.event.returnValue=false>
<script language=javascript src=title.js></script>
<input type=hidden name=isout value=1>
<div id=popupmenu calss=menu align=center onmouseout="document.all.isout.value=1;" onmouseover="document.all.isout.value=0;">
<a href=# target=_blank>管理专区(<u>M</u>)</a><br>
<a href=# target=_blank>网站服务(<u>S</u>)</a><br>
<a href=# target=_blank>网站帮助(<u>H</u>)</a><br>
<a href=# onclick="showModalDialog('about:blank','','dialogWidth:18;dialogHeight:2;dialogTop:50;dialogLeft:200;status:no;help:no;')">关于本站(<u>A</u>)</a><br>
</div>
<script language=javascript>
function click()
{
if (event.button==2)
{
popupmenu.style.visibility="inherit";
popupmenu.style.left=event.x;
popupmenu.style.top=event.y;
}
if (event.button==1 && document.all.isout.value==1)
popupmenu.style.visibility="hidden";
}
document.onmousedown=click;
</script>
</body>
</html>2
--------
<html>
<head>
</head>
<script language=javascript>
<!--
function movestart(){
ilastx=event.x;
ilasty=event.y;
}
function moveme(){
var newleft = movimg.offsetLeft + (event.x - ilastx);
var newtop = movimg.offsetTop + (event.y - ilasty);
if (newleft > 0 && newleft + movimg.offsetWidth < 800 && newtop>0 && newtop+movimg.offsetHeight<600)
{
event.srcElement.style.cursor = "default";
event.returnValue = false;
movimg.style.left=newleft;
movimg.style.top=newtop;
ilastx=event.x;
ilasty=event.y;
}
}
//-->
</script>
<body>
<img id=movimg SRC="http://www.csdn.net/images/ad/vsnet_120.gif" onmousedown="movestart();" ondragstart="moveme();" style="LEFT: 75px; POSITION: absolute; TOP: 10px">
</body>
</html>
<div id=div1 style="position:absolute" onmousedown="DragStart()" onmouseup="DragEnd()"><img src="xxxx.jpg"></div>
<script>
var layerx,layery;
var bDrag; //标记是否开始拖动
function DragStart() //开始拖动
{
layerx=window.event.clientX;
layery=window.event.clientY;
bDrag=true;
}function document.onmousemove() //在鼠标移动事件中,如果开始拖动,则移动层
{
if(bDrag && window.event.button==1)
{
var Layer=document.all.div1.style;
Layer.posLeft += window.event.clientX-layerx;
Layer.posTop += window.event.clientY-layery;
layerx=window.event.clientX;
layery=window.event.clientY;
}
}function DragEnd(){ //结束拖动
bDrag=false;
}
</script>