Here is my code:
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
}
I get the error that:
‘cursorPos is undefined’
Any ideas how to achieve the task of returning a property map from a function. What mistake I am making?
You could solve this using global variables: