Friday, May 1, 2009

Image Hover Effect In Blogger using CSS

Ok lets face the truth wordpress has built in plugins to do this trick or maybe a little tweak in the theme CSS can help you achive the hover effect. So Blogspot users I'm back with another neat and easy blogger tweak for you.

If You're unaware of Image hover effect, then its an effect which brightens an image when mouse pointer is pointed on it. You can check out the demo images below I'm using.

chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios chethstudios

OK love it right? ;) yea as I said its pretty easy hack. So lets start with the coding.

First of all I would like to say PLEASE BACKUP your template. Slight errors can bring bx-errors.

Login into your Blogger Dashboard > Blogger LAYOUT > Edit Html >

Press Press Ctrl+F to open search and search for </head>

and place the below code just above </head>


<style type="text/css">

a.linkopacity img {
filter:alpha(opacity=50);
-moz-opacity: 0.5;
opacity: 0.5;
-khtml-opacity: 0.5;}


a.linkopacity:hover img {
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
-khtml-opacity: 1.0; }

</style>


Yup, now you have to save your template. :)
No its not done yet! Remember the very next time you want to use this effect you have to add class="linkopacity"

For example:

earlier you used

<a href="http://chethstudios.blogspot.com/2009/04/designers-digest-resources-and.html" target="_blank"><img style="width: 50px; height: 35px;" alt="chethstudios" src="http://sites.google.com/site/thumbnailssmall/Home/watchmen.jpg?attredirects=0" /></a>

now you need to add the class for opacity

<a alt="Blogger Widget" class="linkopacity" href="http://chethstudios.blogspot.com/2009/04/designers-digest-resources-and.html" target="_blank"><img style="width: 50px; height: 35px;" alt="chethstudios" src="http://sites.google.com/site/thumbnailssmall/Home/watchmen.jpg?attredirects=0" /></a>



Compare both the codes and you will know what class I'm speaking of :) If in case you have any problem using this little trick feel free to comment here. THe Credits go to blogger stop Enjoy! I will be back soon with a nice tweak, helping you build a better blogger blog! :)


19 comments:

  1. hey thankx for the image hover effect... its really awesome....

    venkateshkumar
    http://kollywoodmoviereview.blogspot.com/

    ReplyDelete
  2. Hey this looks great chetz.. you remember you helped me to install wordpress style animated label cloud in my blog.. I saw that hack in ur blog and was crazy of that label cloud :) like that I want this one also for my blog :)

    ReplyDelete
  3. sweet it works thanks for the tweak

    ReplyDelete
  4. Good post .With your permission can I add this tutorial (In a modified form ) with link back?? Btw cheth , How you manged to arrange the images ad shown above ?? I arranged a bunch of images and each time it slips out when published ~x( .

    ReplyDelete
  5. You can say it looks arranged because of the template coding "image alignment" try playing with it and it will set perfectly. PS: you need to have images of same size.

    Feel free to repost this tut.

    ReplyDelete
  6. Thanks for your tuts, keep writing friend...

    ReplyDelete
  7. Any fix for I.E.? Border is appearing and it looks bad. x(

    ReplyDelete
  8. @Raju : the border appears only on my blog because I've set it like that.. the tutorial codes doesn't have border..

    ReplyDelete
  9. Sorry but it's in my blog that appears

    ReplyDelete
  10. your blog is showing that in IE because your template is not optimised for IE6 png transparency. Fix that issue and it will be fine on IE

    ReplyDelete
  11. where can i find this " template coding "image alignment" ??

    I need to make it look orderly such as the example shown above.

    ReplyDelete
  12. actually never mind the previous post asking for alignment of images. I can do it now!!! thanks heaps!!!

    ReplyDelete
  13. Hey,
    nice tweak. Liked it!!

    ReplyDelete
  14. Is there a similar hack in which the image is converted into greyscale and should colorize on mouse hover? Thanks.

    ReplyDelete
  15. How do I make my icons to 'sink' and then come out fully when hovered over?

    ReplyDelete
  16. Thank you so much for this! Works perfectly!

    ReplyDelete

Please Don't Spam that's all. Grab our RSS Feed and we would Love to see you in our comments section more often.