<img id="ww" OnMouseDown="StartSelect(document.all.m_texSelect)" OnMouseUp="EndSelect(document.all.m_texSelect)" OnMouseMove="move(document.all.m_texLine)" src="LineImage.aspx" border="0" style="z-index:0;position:absolute;" />
function move(texLine)
{
m_texLine=texLine;//文本对象
clear1ine()
var x0=window.event.x-GetDefineX(ww)+document.body.scrollLeft;//取到鼠标点下的横坐标document.body.scrollLeft 得到横滚动条的左偏移
var y0=event.clientY-GetDefineY(ww)+document.body.scrollTop;//取到鼠标点下的纵坐标 event.clientX 得到鼠标在屏幕上的位置。
//判断是否超出范围
if(x0<XOrg||x0>XOrg+Width)return;
if(y0<YOrg||y0>YOrg+Height)return;
GetLine(x0,y0);
//得到最近点的线
GetNearLine(x0,y0);
}
function StartSelect(obj)
{
ww.setCapture();
alert(Row);
obj.value=Row;
}
function StartSelect(obj)
{
alert(Row);
obj.value=Row;
ww.releaseCapture();
}
function move(texLine)
{
m_texLine=texLine;//文本对象
clear1ine()
var x0=window.event.x-GetDefineX(ww)+document.body.scrollLeft;//取到鼠标点下的横坐标document.body.scrollLeft 得到横滚动条的左偏移
var y0=event.clientY-GetDefineY(ww)+document.body.scrollTop;//取到鼠标点下的纵坐标 event.clientX 得到鼠标在屏幕上的位置。
//判断是否超出范围
if(x0<XOrg||x0>XOrg+Width)return;
if(y0<YOrg||y0>YOrg+Height)return;
GetLine(x0,y0);
//得到最近点的线
GetNearLine(x0,y0);
}
function StartSelect(obj)
{
ww.setCapture();
alert(Row);
obj.value=Row;
}
function StartSelect(obj)
{
alert(Row);
obj.value=Row;
ww.releaseCapture();
}
解决方案 »
- JScript运行时错误:“setDayHM”是未定义的 。明明已经定义了
- 有关发布web系统的困惑
- javascript的面向对象编程现在用于什么地方比较多?
- [分享]11个在jQuery代码编写中应该注意的性能原则 - jQuery Performance Rules
- formValidator 的问题
- 这样的JAVASCRIPT函数怎么写?
- 救急啊,高手一下解决的问题,我搞了半天还没出来.
- 服务器端Xml文件正常,下载到客户端后出错:不支持从当前编码到指定编码的切换
- 求不出现任何提示,2秒后自动关闭窗口的代码!
- 给个选择颜色的代码来看看?
- 如何双击一个文本框时不显示以前填写过的数据列表?
- 请问如何在<TR><TD> </TD></TR>中用javascript中定义的变量啊?谢谢!
<head>
<title>test timeControl</title>
</head>
<script language="JavaScript">
function timeControl(name,forObj,fName) {
}
</script>
<body>
<img id="ww" OnMouseDown="javascript:div1.innerText+='mousedown ';" OnMouseUp="javascript:div1.innerText+='mouseup ';" OnMouseMove="javascript:div1.innerText+='mousemove ';" onclick="javascript:div1.innerText+='mouseclick ';" src="a.jpg" border="0" style="z-index:0;position:absolute;" />
<div id="div1" width="100%" height="100%"></div>
</body>
</html>
可以下起用啊, 应该是你的代码有问题
把alert()去掉