Demo: Place your mouse over the image below to see its rollover effect
Making Rollover Effect 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 where somebody will be sent when clicks on the image.
Example, my blog address: http://www.helplogger.blogspot.com
2. URL OF THE FIRST IMAGE GOES HERE
Replace the orange text (two times) with the URL address of the image which will appear before you hover over it.
3. URL OF THE SECOND IMAGE GOES HERE
Replace the text in blue with the url of the image that will appear when the cursor hovers over it.
Now you can paste your image inside a blog gadget, going to Layout > click on Add a Gadget link (right side) > Select HTML/JavaScript from the pop-up window, then add it to your sidebar.
You can also add it inside your post by going to New Post > Switch to HTML tab and then paste the code in the empty box.
That's it. Enjoy ;)



Why not to use CSS Sprite? I tried it but it increases the page loading time. CSS sprite is better idea though it take some time and work its worth.
ReplyDeleteYes Agree With You. CSS Sprite Can Atleast Decrease http Requests :)
Deletethe page search for long time sure
ReplyDeleteIs this trick is right for our blog? Because CSS make blogs loading heavy..
ReplyDeletewhat if i want to chagne the size of the images?
ReplyDeleteThen You Also Need To Add Extra CSS Code. If Want To Change Size Of Image On Hover
Deleteimg:hover
{
zoom: 125%;
}
Thank-You! I love it!
ReplyDeleteput the size after mouseout url
ReplyDeleteonmouseout="this.src='URL OF THE FIRST IMAGE GOES HERE'"width="190" height="50" />
Hey i know CSS Sprites but i dnt want to use that so i was searching for a event clicks and i got it here.. Thanks a lot for sharing this... this is what i want
ReplyDeletethanks for this tutorial. thumb up
ReplyDeleteThanks
ReplyDeleteI entered in the code but nothing is happening... the picture isn't loading and it's just left an empty box where the picture should be. Advice?
ReplyDeleteThanks!
Hi Jordan,
DeleteI see no reason why they would not appear. Could you please send me the code that you have entered or the url of your pics? My e-mail address is helplogger76@gmail.com
I got it! I was using the wrong embedding link... thanks for your support.
DeleteThank you for this tutorial! It works great when I post the code into a Blogger post, but when I try to add the code as a widget in the crosscol section, it doesn't work - doesn't change when I hover, and also isn't clickable. I wondered if the container was locked or something, but that doesn't seem to be the case. Any thoughts as to why this is? My email is kvaughndesign@gmail.com. Thank you!
ReplyDeleteThanks for the code, simple and clean code to use..
ReplyDeleteI'm working in wordpress and it works in my edit mode but when I preview it it doesn't work. What do you think is wrong?
ReplyDelete