HOME
            About US
            Contact Us
            Fun Games

On Mouse Click
On Mouse ClickOn Mouse Click

Chapter - 13 : On Mouse & On Key Commands (On Mouse Click): (Page 3/5)


(Cotinued from previous page)

13.4- On Mouse Over: This command works, as soon as your mouse pointer reaches on the position defined. This is defined along with the tern 'Mouse Out'. This also has got the command as

onmouseover='somefunction()' -
Activated when mouse pointer is over the object
onmouseout='somefunction()' -

Activated when mouse pointer get out from object

Some of its uses are -

a) To change the color of the text as soon as mouse goes over the text
<p onmouseover='this.style.color='blue'' onmouseout='this.style.color='black''>
Your Text </p>


In the above example as soon as mouse pointer reaches on 'Your Text', the font color will change to blue (FIG- 13.4). Whenever the mouse pointer goes out from text, it will become black (FIG- 13.3).

b) To change the Image : If you want to toggle between two images on mouse movement -

<img src='old.gif'
onmouseover='src='new.gif''
onmouseout='src='old.gif'' />

Here on your web page you will see the image old.gif (FIG- 13.5). But as soon as the pointer moves over it, the new.gif (FIG- 13.6) image will be visible. Again as mouse is out, the old.gif (FIG- 13.7) will be visible.

(Cont......... to next page (Pg-4))

© funandhobby.com (On Mouse Click)