August 13, 2011

How To Add a Cool Fade Effect to Images on Your Blog


This effect you will see a fade effect when you move your mouse over an image.This is cool jquery effect..

how To Add a Cool Fade Effect to Images on Your Blog

1. Login to your blogger Dashboard--> Design- -> Edit HTML

2. Scroll down to where you see </head> tag.

3. Copy below code and paste it just before the </head> tag.













<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function(){
$(".post img").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
$(".post img").hover(function(){
$(this).fadeTo("slow", 0.5); // This should set the opacity to 100% on hover
},function(){
$(this).fadeTo("slow", 1.0); // This should set the opacity back to 30% on mouseout
});
});
</script>
<script type='text/javascript'>
$(document).ready(function(){
$(".latest_img").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
$(".latest_img").hover(function(){
$(this).fadeTo("slow", 0.5); // This should set the opacity to 100% on hover
},function(){
$(this).fadeTo("slow", 1.0); // This should set the opacity back to 30% on mouseout
});
});
</script>

4.Click on Save template You are done.

Cheers..!

No comments:

Post a Comment