How to get return value from mouse capturing fucntion?

Posted by Babiker on Stack Overflow See other posts from Stack Overflow or by Babiker
Published on 2010-06-02T18:22:49Z Indexed on 2010/06/02 20:14 UTC
Read the original article Hit count: 162

Filed under:

How to get return value from mouse capturing function?

        function getMousePosition(e) 
        {
            positionX = e.pageX;
            positionY = e.pageY;

            if (positionX < 0){positionX = 0;}
            if (positionY < 0){positionY = 0;} 

            return positionX + " " + positionY;
        }

as in var mousePositions = getMousePosition(e);

© Stack Overflow or respective owner

Related posts about JavaScript