Javascript onmouseover Set Window Status

by top54u.com 20 May, 2008
Spotlight.....

In the previous article we learnt how to use DOM object window to set the text in the status bar of a window. You can use the same status property to set the different text in the status bar using onmouseover event of different html tags. Onmouseover event takes action when mouse pointer moves over any html event e.g. html button, hyperlink or image.

 

Here we will learn to set the window status bar text on onmouseover event of <img> tag of html code.

 

Javascript Code to Set Window Status using onmouseover

<html>
<head>
    <title>JavaScript onmouseover set Window Status</title>
</head>
<body>


<img src="image1.jpg" onmouseover="window.status='your mouse is rolling over image 1';" onmouseout="window.status='';"><br />


<img src="image2.jpg" onmouseover="window.status='your mouse is rolling over image 2';" onmouseout="window.status='';"><br />


<img src="image3.jpg" onmouseover="window.status='your mouse is rolling over image 3';" onmouseout="window.status='';"><br />


</body>


</html>

 

As shown in the above code you can also use the onmouseout event to remove the window status text when mouse moves out from the <img> element of html.
Above example will display the different onmouseover window status messages for each image. You can display the image description similar to the alt attribute of image tag in window status bar.

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

7/24/2008 5:26:37 PM

OUR SPONSORS[+ advertise here]
top54u ezines.....
related videos.....
recent posts.....