Categories:

Home / Free JavaScripts / Links / Here

Cut & Paste

Credit: JavaScript Kit

Description: An alternate version of the popular rollover effect script that checks a check box instead when the mouse moves over a link. Not too useful, although quite amusing.

Example:

Home
JavaScript Tutorials
Free JavaScripts
Free Java Applets
Web Tutorials
FrontPage tutorials

Directions: Simply insert the below into the <body> section of your page where you want the links to appear:

Configuring the script: The script used to create the rollover effect is actually very short and simple- the majority of the code are HTML codes used to render the checkboxes. Anyhow, the key thing to understand is that each <a> tag contains the code:

<a href="test.htm" onMouseover="rollovercheck(0)" onMouseout="rolloutcheck(0)">

The integer 0 inside the parenthesis indicates that when the mouse moves over this link, it should  check the first check box (JavaScripts counts from 0, remember?). Therefore, if you have 100 links, the hundredth link will contain the code:

<a href="test.htm" onMouseover="rollovercheck(99)" onMouseout="rolloutcheck(99)">'

so when the mouse moves over it, the script correctly checks the box beside it.

Play around with the code, and you'll see what I mean.


JavaScript Tools:
Site Info


CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info