易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript实现拖放,地图推移,

startDrag: function(elem) {
elem.onmousedown =function(ev) {
dragObject  = this;
mouseOffset = ws.m.pin.getMouseOffset(this, ev);
return false;
}

},

//information on where we clicked our item
getMouseOffset:function (target, ev){
ev = ev || window.event; 
var mousePos  = ws.m.pin.mouseCoords(ev);
var docPos    = ws.m.pin.getPosition(target);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
},

//the coordinates of an item relative to the document
getPosition:function (e){

var left = 0;
var top  = 0;
left = e.offsetLeft ;
top  = e.offsetTop ;
return {x:left, y:top};
},

//capture the mouse coordinates
mouseCoords:function (ev){
if(ev.pageX || ev.pageY){
    return {x:ev.pageX, y:ev.pageY};
}
return {
    x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
    y:ev.clientY + document.body.scrollTop  - document.body.clientTop
};
        },

//Moving an Item
mouseMove:function  (ev)  {
ev  =  ev  ||  window.event;
               


相关问答:

请教JavaScript键盘问题 - Web 开发 / JavaScript

怎么才能判断键盘是否被按下和松开。。。。。不知道怎么判断。。。谁能告诉我下吗。。。。谢谢
onkeydown和onkeyup事件

引用
onkeydown和onkeyup事件
自动触发这两个事件

onkeydown 按下
onkeyup 松开

......

JavaScript正则表达式

 
问题内容:判断顺序号列及子序号列必须为数字。
<td><div align="center"><input type="text" name="xuHao${g+1}" class="inputW" value="& ......

Javascript 获取ID

设有众多div层 希望点击到那个层,就获得那个层的id
问题是 我想把id转换成一个可以alert的数字
因为我需要这个数字来确定数组中的某一项
例如
我定义某个div的id为e1
点击他后 与之对应的数组aaa[1]中的数据返 ......

关于JavaScript的prototype和instanceof

JScript code:

function C1(){}
function C2(){}
C2.prototype=new C1();
function C3(){}
C3.prototype=new C2();
var obj=new C3();
function C4(){}
C3.prototype=new C4();
alert(obj insta ......

引用javascript引擎

在网上找到的源码,可是执行不了,请前辈们看看,
执行+-*/是可以的
C# code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.CodeDom.Comp ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号