Jump to content

[Guide]Change Image on Mouseover Javascript


xXxExosoulerxXx

Recommended Posts

This is a small javascript that changes an image on mouseover. Run your mouse on the image above to see the rollover effect. The image contains a link and is a great script for any webpage.

 

The mouseover script is also useful for those learning javascript. Have a look at the code and see how easy it is to follow.

 

Installation:

 

STEP 1.

 

Make 2 images which you would like to display. You can name them #1 and #2 if you wish and they can be jpg or gif format. Upload the images to your server.

 

STEP 2

 

Copy the code below and paste this between the <head> and </head> tags of your html document. Point the script to where the images reside on your webhost. By this I mean change image source lines:

image1.src = 'images/rollover1.jpg' and

image2.src='images/rollover2.jpg'

 

The lines in red should show where your images are stored and your image name. The example shows that my images are stored in the images folder and the names are rollover1.jpg and rollover2.jpg. You may need to use your full url such as http://wwww.yoursite.com/image1.jpg

 

<script 
language="Javascript"> <!-- http://l2justice.servegame.com if (document.images) 
{ image1 = new Image image2 = new Image image1.src = 'images/rollover1.jpg' image2.src 
= 'images/rollover2.jpg' } --> </script>

 

 

STEP 3.

 

Copy the code below and paste this into the body of your html document, where you want the images to appear on your webpage.

 

Again change the image source to suit at this line; img src="images/rollover1.jpg"

(Note that you only need to change the image1 here. The second image is called by the script.)

 

 

<a href="http://l2justice.servegame.com" 
onMouseOver="document.rollover.src=image2.src" onMouseOut="document.rollover.src=image1.src"> 
<img src="images/rollover1.jpg" border=0 name="rollover"></a>

 

That's it. Good luck.

 

 

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Thank you very much, but now, if i spawn a raid, i see in chat, but npc isn;t spawned, it's visual bug?  
    • +256783219521 N1 WITCHCRAFT SPELLS CASTER IN TEXAS USA/UK EU.   ARE YOU DESPERATE FOR ATTRACTION OR YOU WANT YOUR EX LOVER BACK INTO YOUR LIFE AND YOU ARE , DESPERATE  BECAUSE YOU HAVE NO ONE TO TALK TO,  THEN WORRY AND CRY NO MORE BECAUSE THE SOLUTION IS AT HAND AND YOUR PROBLEMS WILL BE NO MORE. HERE COMES PSYCHIC MAGGU A SPECIALIST WITH VAST EXPERIENCE SPANNING 25 YEARS AS A LOVE SPELLS CASTER, MARRIAGE SPELLS CASTER, BINDING SPELLS CASTER, LOST LOVE SPELLS CASTER, ATTRACTION SPELLS CASTER, PSYCHIC,WEALTH SPELLS, TRADITIONAL HEALER, DIVINER,MEDIUM, FINANCIAL SPELLS, VOODOO,WORK RELATED SPELLS, BLACK MAGIC, WHITE MAGIC.  WITH SUCH EXPERTISE, I HAVE BEEN ABLE TO WORK ON CLIENTS FROM DIFFERENT PARTS OF THE WORLD INCLUDING BUT NOT LIMITED TO USA, CANADA, EUROPE, UAE, INDIA, SOUTH AFRICA, ASIA, INDONESIA, BOTSWANA. IF AT ALL YOUR PROBLEMS PERSISTED FOR A LONG TIME  AND YOU HAVE FAILED TO GET A LASTING AND PERMANENT REMEDY SO THAT YOU LIVE A HAPPY AND BLISSFUL LIFE, PLEASE DON'T HESITATE TO CALL/ WHATSAPP +256 783219521  . 
    • #REAL BLACK MAGIC SPELLS CASTER IN USA UK +256783219521 POWERFUL BLACK MAGIC SPELLS CASTER|Witchcraft Spells Caster In USA UK AUSTRALIA CANADA NEW ZEALAND EUROPE SOUTH AFRICA SOUTH AMERICA ASIA IRELAND (USA) New York,California,Florida,Georgia,South Carolina,North Carolina,Virginia,West Virginia,Alabama,Louisiana,Mississippi,Tennessee,Kentucky,Delaware,New Jersey,Maryland,Ohio,Indiana,Michigan,Pennsylvania,Connecticut,Rhode Island,Massachusetts,New Hampshire,Vermont,Maine,Texas,Oklahoma,Arkansas,Wisconsin,Illinois,Minnesota,Iowa,Missouri,Kansas,New Mexico,Arizona,Nevada,Utah,Colorado,Nebraska,South Dakota,North Dakota,Montana,Wyoming,Oregon,Idaho,Washington,Fertility,Attraction,Binding Spell Caster In South America,24 Hours Online Love Psychic Reader,Native Herbalist,Sangoma,Traditional Healer in South Africa,Canada Best Lost Love Spell Caster,Strong Medium For Gays/Lesbians Relationships,Trusted Interracial Love Marriage Healer,POWERFUL Native Incantation Love Spell Caster in UK,Europe,Australia,Faithful Islamic-Arabic Divine Love Spells In Middle East,Top Online Love Traditional Doctor In USA,The Bahamas,Trusted Traditionalist in ALL Counties,A Love Spell Caster in Poland UK,Binding Love Spell In Dubai,Bring Back Lost Love Spells In Australia,Online Magic Love Charms In Australia,Bahama Best Online Love SPELL Caster,A Powerful Voodoo Love Spell Caster In German,France,Norway,A Powerful Native Binding Spell Caster In United Kingdom,Powerful Love Doctor In Ireland,Sweden,Italy,Black Magic Spell Caster In Philippines,NEW LAND,Denmark,Sangoma In Gauteng South Africa,Spain Love Medium Psychic,Islami Arabic Divine Lost Love Medium,EX Back Spell Caster In Mauritius,A Best Bring Back Lost Love Spell Caster In The Bahamas,Saudi Arabia,Kuwait,A Love Spell Caster In South America,A powerful Traditional Healer In Caribbean."IF YOU CAN'T SEE IT,DOESN'T MEAN IT'S NOT THERE"WELCOME TO AN EXPERIENCED[19 YEARS OF SERVICE] BLACK MAGIC NATIVE TRADITIONAL HEALER, LOST LOVE SPELLS CASTER, LOVE SPELL CASTER, HEALER, HERBALIST, BINDING SPELL CASTER,MEDIUM OF LOVE,BEST ONLINE PSYCHIC READER,SANGOMA,WITCH DOCTOR [PSYCHIC- MAGGU +256783219521.
  • Topics

×
×
  • Create New...