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);
   }); 
})

Source : http://docs.jquery.com/Tutorials:Mouse_Position

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!