![]() |
Programming JavaScript . onmouseover / onmouseout function |
|
|
||||||||
|
The onmouseover is triggered if the user moves the mouse over the document object (e.g. an image with a hyperlink). The onmouseout is run if the mouse pointer moves out of the object. |
|||||||
|
single action for any hyperlink <a href="javascript:void(0)" onmouseover="your_function_name_if_mouse_over('anyParameter');">...</a> <a href="javascript:void(0)" onmouseout="your_function_name_if_mouse_out('anyParameter');">...</a> combined into one hyperlink <a href="javascript:void(0)" |
|||||||
|
// the html HEAD part <head> ... standard head stuff ... <script language="JavaScript"> // preloading the required images myImg_mouseover = new
Image(64,32); myImg_mouseout = new
Image(64,32);
function CyG_JS_setOnMouseOverImage(myImage) function CyG_JS_setOnMouseOutImage(myImage) </head> // the html BODY part <body> // "javascript:void(0)"
tells the browser no link to be followed; you might put a regular link
here... </body>
|
|||||||
|
move the mouse over the image and see the rectangle
change its colour move the mouse out of the image and see the
rectangle get white again |