.mouse() - relative position of mouse
Gets the relative position of mouse over an element with repect to itself. mouse() will be mostly used within the listener function of mouse events.
Returns
TypeDescription
JSON{ x : AA, y : BB}, where AA and BB are position of mouse over the element in pixel
Example 1
Find the relative position of mouse pointer inside the div box. Move the mouse cursor over the div.
JS HTML CSS
		$.domLoaded(function() {
			
			$.get("#box1").on("mousemove", function() {
				
				// Get the relative mouse position
				var po = $.self().mouse();
				
				$.get("#msg").html("Mouse is at  x : " + po.x + " y : " + po.y);
				
			});
		});						
					
						
<body>
	<div id="box1">Mouse over me</div>
	<br/>
	<div id="msg"></div>

</body>
	div {
		display : inline-block;
		padding : 10px;
		margin : 5px;
	}
	
	#box1 {
		width : 200px;
		height : 100px;
		border : 2px solid red;
	}
Result