March 22, 2011
Highlight one side border on hover – JavaScript
Question by Vijay
I am trying to provide an interface that allows the users to create a table structure. This is similar to how Microsoft Word provides the insert table functionality. I am using JavaScript for this purpose.
User should be able to select a border (line) and delete it to merge the cells. So, I have to highlight a one side border of a cell to be able to visualize it.
Is it possible to identify the mouse position when it moves on the border?
Answer by Starx
If you are OK, with Jquery, there here is a tutorial showing how to identify mouse coordinates.
jQuery(document).ready(function(){
$(document).mousemove(function(e){
$('#status').html(e.pageX +', '+ e.pageY);
});
})