HOME
            About US
            Contact Us
            Fun Games

On Mouse Movement
On Mouse MovementOn Mouse Movement

Chapter - 13 : On Mouse & On Key Commands (On Mouse Movement): (Page 4/5)


(Cotinued from previous page)

13.5- On Mouse Movement: This command works, when the mouse pointer moves over an object.
Mouse Movement is different from the 'Mouse Over' in the sense that it is activated till the time Mouse is under movement, but Mouse Over is activated till the mouse is over the object.

onmousemove='somefunction()' - Activated when mouse pointer is under movement over the object

Some of its uses are -
a) To change the color of the text as soon as mouse goes over the text

<p onmousemove='this.style.color='blue''>
Your Text </p>

In the above example as mouse is moves over 'Your Text', the font color will change to blue.

b) To change the Image : If you want to change the image as mouse moves over it -

<img src='old.gif'
onmousemove='src='new.gif'' />


Here on your web page you will see the image old.gif. But as soon as the pointer is in movement over the image, the new.gif image will be visible.

Here the java function is defined in 'head' tag and 'onload' event with 'body' tag. When the page is completely loaded, then visitor will see a massage 'The Web Page is completely Loaded ' on screen (FIG- 13.8).


13.6- On Load Event: This event gets activated as soon as the web page is completely loaded including the external element. This event is mostly applied to the 'body' tag.

<head>
<script type='text/javascript'>
function load()
{ alert('The Web Page is completely Loaded '); }
</script>
</head>
<body onload='load()'>

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

© funandhobby.com (On Mouse Movement)