Changing Cursor on Image Hover using JavaScript

The event captured in this case is “onMouseOver” and “onMouseOut” .

The cursor can be changed with the following script:

onmouseover=”this.style.cursor = ‘hand’;”
onmouseout=”this.style.cursor = ‘auto’;”

 Example:

imageLinkForDemo.Attributes.Add(“onMouseOver”, “this.style.cursor=’hand’”);

Now whenever a user hovers on the image, the mouse cursor changes to a hand image.

~ by Neha Sinha on January 30, 2008.

3 Responses to “Changing Cursor on Image Hover using JavaScript”

  1. is it possible to keep my own image to the cursor say
    onmouseover=”this.style.curso’vasu.jpg’”. i want this requorement if u know plz reply to my mail call2kancherla@gmail.com

  2. @Srinivas : You can use the below code on page head..

    To read more about this goto http://www.javascriptkit.com/script/script2/customcursor.shtml

  3. Thanks it helped me

Leave a Reply