Sunday 22 July 2012

Create A Rollover Image Effect (change image on mouseover)


The Rollover effect is one in which an image web object changes (swaps itself) on mouse over to another web object (called rollovers) and reverts back to the original image on mouse out. Rollover images are preloaded into the page when it is loading, this ensures that the rollovers are displayed quickly. The onMouseOver and onMouseOut attributes of the link tag are used to make this functional.



DEMO:  Touch the above image.

You have the following code:


<a href="URL ADDRESS"><img src="URL OF THE FIRST IMAGE GOES HERE" onmouseover="this.src='URL OF THE SECOND IMAGE GOES HERE'" onmouseout="this.src='URL OF THE FIRST IMAGE GOES HERE'" /></a>


Change the colored texts as it follows:


1.) URL ADDRESS


                This is the address you want the image to lead to when it's clicked.
Example : In the above image when clicked you will be taken to http://toolsforblogger.blogspot.in


2.) URL OF THE FIRST IMAGE GOES HERE 



                Replace the red text (two times) with your first image's url address - this is the image shown before you hover over it.


3.) URL OF THE SECOND IMAGE GOES HERE


                  Replace the text in blue with the url of your second image - this image will appear when your cursor hovers over it.

Now you can paste your image inside a blog gadget, going to Page Elements > Add a Gadget > Select "HTML/JavaScript and add it to your sidebar Or you can add it inside your post by going to New Post > Switch to Edit HTML tab and then paste the code in the empty box.

That's it.

Feel free to hit Like, Share or Comment if you like the Post.

3 comments:

  1. You do not have anything to reduce, you will want to give outsourcing a try.
    While utilizing a payroll service, you opt for checks issued
    by the due date and delivery process. Grants management is a core activity inside a development
    office.

    Also visit my weblog ... payroll online

    ReplyDelete
  2. What's up everyone, it's my first pay a visit at this website, and post is genuinely fruitful in support of me, keep
    up posting such posts.

    Have a look at my web site: soodne väikelaen

    ReplyDelete
  3. This site was... how do you say it? Relevant!! Finally I've found
    something that helped me. Kudos!

    Here is my blog Property Manager Minneapolis

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...