这里返回酒店的地图是我的代码`的Javascript:从功能
function currentCursPos(){
$(document).mousemove(function(e){ var pos= {"x":e.pageX,"y":e.pageY}; return pos });
}
function clrpckrTopPos(){
//var cursorPos={};
var cursorPos=currentCursPos();
if(cursorPos.y<$("#colorpickerDiv").height()){return cursorPos.y+$("#colorpickerDiv").height()}
if(cursorPos.y>$("#colorpickerDiv").height()){return cursorPos.y}//colorpickerDiv2 and colorpickerDiv have same height
} `
。 我得到'cursorPos未定义'的错误 。 任何想法如何实现从函数返回属性图的任务。我正在犯什么错误?
什么是这些功能的整体意图是什么?你想知道某个事件发生后鼠标的位置?或者你是否想要对鼠标位置作出反应? – natedavisolds 2012-03-18 16:29:27