Showing posts with label Blogger HTML. Show all posts
Showing posts with label Blogger HTML. Show all posts

Create a List/Grid View Switcher in Blogger with Auto Read More

You might noticed a list/grid view switcher in many blogs/website. List/Grid view switcher is a cool feature that allows users to choose whether they want to see posts in a list view with read more option or a grid view depending what the prefer. However, it is visible to the index pages only like Homepage, Label pages, Archive pages.

Also see: How to Add Blogger and Google+ Comments System With Toggle



How to create a list/grid view switcher in blogger?

Go to Blogger dashboard>Template>Edit HTML
Press CTRL + F to enable search box, Search for the following code

</head>

Just above the </head> tag, copy and paste the following CSS style and scripts:

<script type='text/javascript'>
function list_view(){
if(document.getElementsByClassName(&quot;post&quot;)) {elementArray = document.getElementsByClassName(&quot;post&quot;); while (elementArray.length) {elementArray[0].className = &quot;post-grid-view&quot;;}}
if(document.getElementsByClassName(&quot;post-title&quot;)) {elementArray = document.getElementsByClassName(&quot;post-title&quot;); while (elementArray.length) {elementArray[0].className = &quot;post-title-grid&quot;;}}
}
function grid_view(){
if(document.getElementsByClassName(&quot;post-grid-view&quot;)) {elementArray = document.getElementsByClassName(&quot;post-grid-view&quot;); while (elementArray.length) {elementArray[0].className = &quot;post&quot;;}}
if(document.getElementsByClassName(&quot;post-title-grid&quot;)) {elementArray = document.getElementsByClassName(&quot;post-title-grid&quot;); while (elementArray.length) {elementArray[0].className = &quot;post-title&quot;;}}
}
</script>
 <script type='text/javascript'>
posts_no_thumb_sum = 100;
posts_thumb_sum = 350;
</script>

<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
function createSummaryAndThumb(pID, pURL, pTITLE){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = posts_no_thumb_sum;
if(img.length>=1) {
imgtag = '<span class="posts-thumb" style="float:left; margin-right: 10px;"><a href="'+ pURL +'"><img src="'+img[0].src+'" /></a></span>';
summ = posts_thumb_sum;
}

else {
imgtag = '<span class="posts-thumb" style="float:left; margin-right: 10px;"><a href="'+ pURL +'" title="'+ pTITLE+'"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1_dR48d51D7n78r5d72GhyphenhyphenTsvJ0IVp-ebi7baEEB16D66G248BjQyBBLsw63CRi2vqkuTXMJxfXUC95TFp3sTu6F-nl5BZlT79sa9-EICCnCFcuXLsk7qb6fwJygB5u-WGPX3bZGt91s/s1600/sorry-image-not-available.png" style="margin-top: -30px;" /></a></span>';
summ = posts_thumb_sum;
}

var summary = imgtag + '<a href="'+ pURL +'"><div class="post-summary-text">' + removeHtmlTag(div.innerHTML,summ) + '</div></a>';
div.innerHTML = summary;
}
//]]>
</script>

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType!= &quot;item&quot;'>
<style>
#list-view-button {font-family: Verdana; text-align:left;cursor:pointer;font-size: 14px;border-bottom: 5px solid #eaeaea;text-decoration: none;}
#list-view-button a{text-decoration: none; color: #666;}
.grid-view-button {background-color:#efefef;color:#666;padding:5px 10px;border-radius: 5px;font-size: 12px;}
.list-view-button {background-color:#efefef;color:#000;padding:5px 10px;border-radius: 5px;font-size: 12px;}
.post-grid-view {width:100%;height:250px;overflow: hidden;float:left;margin:0px 0px 20px !important;position:relative;display: block; -webkit-transition:all 0.5s ease 0s; -moz-transition:all 0.5s ease 0s; -o-transition:all 0.5s ease 0s; transition:all 0.5s ease 0s; }
.post-grid-view .posts-thumb {width:40% !important;height:250px !important;float:left;margin:0px;position:relative;border-top: 0px solid transparent !important;overflow: hidden;}
.post-grid-view .post-header {display: none;}
.post-grid-view .post-body img {min-width: 300px !important; min-height: 250px !important;display:block;width:100%!important;height:auto!important;max-width:800px!important;max-height:400px!important;border:none;outline:none;position:relative;margin: 0px;padding:0;}
.post-grid-view .post-summary-text {opacity: 1; background: none; width: 58%;font-size: 120% !important;clear: none !important; display: inline-block !important; padding: 80px 0px !important; color: #666 !important; text-shadow: none !important; float: right !important; text-align: left; position: relative !important; font-family: &#39;Open Sans Condensed&#39;, sans-serif;}
.post-grid-view .post-body {height: 250px;background:#f5f5f5; box-shadow: none !important;}
.post-title-grid a { font-size:170%;color: #777;font-family: &#39;Open Sans Condensed&#39;, sans-serif;}
.post-title-grid { position: absolute; left: 42%; top: 5%; z-index: 1;}
.post-grid-view .post-footer {left: 41%; display:block;position: absolute; bottom: 2%;font-size: 120%; background: transparent !important; border: 0px solid transparent !important;font-family: &#39;Open Sans Condensed&#39;, sans-serif;}
.post-grid-view .post-footer a{color: #128EC9;}
.post-grid-view a.comment-bubble {display: none;}
.main-inner .column-center-inner .section {margin: 0px !important;}
.post { -webkit-transition:all 0.5s ease 0s; -moz-transition:all 0.5s ease 0s; -o-transition:all 0.5s ease 0s; transition:all 0.5s ease 0s;}

#blog-pager {clear:both;}
.post {height:auto;width:32.2%;display:inline-block;text-decoration:none;float:left;margin:0 1% 1% 0%;overflow: hidden;padding:0!important;}
.date-header {display: none;}
h3.post-title a {font-size:90%;font-family: &#39;Open Sans Condensed&#39;, sans-serif;text-transform:uppercase;color:#fff;text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);font-weight: bold;}
h3.post-title {text-align: center; position:absolute;top:0;width:100%;overflow:hidden;margin:0px !important;padding-top: 30%; background-color: rgba(50, 126, 213, 0.8);transform: scale(1);opacity: 0;z-index: 10;height: 100%;transition: all 300ms ease-out 0s;}
h3.post-title:hover {opacity: 1;}
.posts-thumb {width:100%!important;height:200px!important;overflow:hidden;clear:both;}
.post-body {border-radius:2px;box-shadow:0 5px 4px 1px rgba(0,0,0,0.1);position:relative;overflow: hidden;}
.post-body a {text-decoration: none;}
.post-body img {display:block;width:100%!important;height:auto!important;max-width:800px!important;max-height:400px!important;min-width:200px!important;min-height:200px!important;border:none;outline:none;position:relative;margin: 0px;padding:0;}
.post-summary-text {display: none;}
a.comment-bubble {color:#fff;text-decoration:none;font-size:100%;width: 100%;text-align: center;position:absolute;top:175px;left: 0px;text-shadow:1px 2px 1px #333;font-family: &#39;Pacifico&#39;, cursive;z-index: 122;}
a.comment-bubble:before { content: &quot;Comments: &quot; url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnUcp4YJ8n7OoHRT_OLj2bhhXTOGvVnke1jJ1MW7kBBbIYNDUkNrsdFVL8C4c2Eyn_5H1d2gcs5o90XVBuSm30ZMOgZ7FTD_fiK8IS_6DDWTIgHisrpZUS0S6GlMRp3fq72mOvXG7_j50/s1600/heart-active.png);}
.post-header,.post-footer {display:none;}
</style></b:if></b:if>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'/>

Next, search for the following line:

    <b:section class='main' id='main' showaddelement='no'>

...in case you can't find it, search for this one instead:

    <b:section class='main' id='main' showaddelement='yes'>

Now, Just above this line, add the following code:

    <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
    <b:if cond='data:blog.pageType!= &quot;item&quot;'>
    <div id='list-view-button'><a class='grid-view-button' onclick='grid_view()'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg57l5fnIkD4vnA3JPd_s-TRkSReis9FohQz6JmJ066pq66o49Q_2524P9QdxqiPjTJWZclQqZypD-DnX2a1SjJwFijgvan5fjyoJbkzod3ncMjj62o-OrxGp19pyyHXLulVN7mGVFX1pw/s1600/search-grid-icon.png' style='margin: -8px 1px -3px -6px;width: 16px;'/> Grid View</a> <a class='list-view-button' onclick='list_view()'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihY25Vj8oybb206UpdPgUVPMV75Bljq8JBdsfXbBSxheNcJxUxbp9q896UoXU0koEuHklMNZKSkwEpLnVSTRbVsB5haOwlVYf8tmkGcgM-r4zbIXC_lZQ1ZIrbXKdWvTq1BKdEkQKBXJw/s1600/icon-list-view.png' style='margin: -8px 1px -3px -6px;width: 16px;'/> List View</a></div>
    </b:if></b:if>

Now, search the code below:

    <data:post.body/>

You will find 3 occurrences of this code, replace only the second and third one with this one below:

     <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
        <b:if cond='data:blog.pageType != &quot;item&quot;'>
            <div expr:id='&quot;summary&quot; + data:post.id'>
                <data:post.body/>
            </div>
            <script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;,&quot;<data:post.url/>&quot;);</script>
            <b:if cond='data:post.allowComments'>
                <a class='comment-bubble' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'>
                    <data:post.numComments/>
                </a>
            </b:if>
        </b:if>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
        <data:post.body/>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
        <data:post.body/>
    </b:if>

Important: if you already added the auto read more script, remove the previous one in order to make this work.

Finally, click "Preview" to see if everything looks good and press the 'Save Template' button to save the changes...

That's it.

Drop your comments and questions below.

Featured images not showing up on blogger index/pages [Fixed]

In one of my blog techiemate.com i faced an issue with its featured images that wasn't displaying on the index pages of blogger blog. And then i found the solution to fix it. And now i decided to share how i fixed it with all of you because you might have same issue with the same as recently Google blogger changed its protocol to http to https even it changed to the new images you upload. You can check your blog's post's images where you will see the URL of the image which will be start with HTTP and then go to the new post and upload the image and look for the Image URL it would be start with HTTPS and this is what stopping featured images to show up on the homepage and other index pages.

Also see : Show each blogger post's featured image on index pages (Different than inserted into the post)

OK so, if you are facing the same issue with your blog, then all you have to do is to remove "S" from the protocol of a specific image URL which you want it to be displayed on the index pages.

as an example, when you upload an image to the post, its URL should be look like this :

https:https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggR0gRxdfk5GPhHrC4gqpnj8J0fZpm25D5j-MMlMYd4fkVWEzJognjE9-MFH0SnEf6LYo030mSIaUxmbs3ZSxl35I8Nou-T32TFfFyAyLArYxO5eKTsMmqzSE3PK3nrIbO2jzZL-5nGQ/s640/1-ravi-varma-paintings.jpg

As you can see in above red colored text in the URL, which you have to change with HTTP and it would be look like this :

http:https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggR0gRxdfk5GPhHrC4gqpnj8J0fZpm25D5j-MMlMYd4fkVWEzJognjE9-MFH0SnEf6LYo030mSIaUxmbs3ZSxl35I8Nou-T32TFfFyAyLArYxO5eKTsMmqzSE3PK3nrIbO2jzZL-5nGQ/s640/1-ravi-varma-paintings.jpg

That's all.

Still if you have any questions about the same, feel free to ask by commenting below. Thanks !

Add Random Posts In Blogger to Increase the PageViews

Random posts widget is must have widget for blogger because it really helps you to increase in your daily page-views as visitor of your blog will see more and more hidden content of your blog as soon as they refresh the page. You can display random posts widget anywhere in your blog, sidebar is the best place it add it. as soon as people refresh the page a random posts will be displayed as same as you can see the screenshot below. Your posts titles will be displayed that you can also choose how many posts you want to be displayed. Every time when you blog's readers refresh the page, the widget will be displayed with different title/posts of your blog each time.


So, now if you would like to have this widget to be installed on your blog, then don't need to worry about it as it is pretty simple to make this job done. all you will need to do is just follow the steps given below to add this awesome random posts widget to your blog.

Also see : Related Posts Widget with Thumbnails and Summary for Blogger

How to add Random posts widget in blogger?

Go to blogger dashboard > Template > Edit HTML
Search for ]]></b:skin> tag, and paste below code just above it.
#random-posts{
border: 1px solid #aaa;
margin: -20px 0;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
-moz-box-shadow: 0 5px 5px -5px #999;
-webkit-box-shadow: 0 5px 5px -5px #999;
box-shadow: 0 5px 5px -5px #999;
background: #f6f6f6;
background: -webkit-gradient(linear, 0% 40%, 0% 70%, from(#f9f9f9), to(#f1f1f1));background: -moz-linear-gradient(linear, 0% 40%, 0% 70%, from(#f9f9f9), to(#f1f1f1));
}
#random-posts li{
background: url(http://i.imgur.com/d2qDDPf.png) no-repeat 12px;
border-bottom: 1px solid #ccc;
font-family: cambria;
font-size: 12pt;
list-style-type:none;
margin:0;
padding:6px 10px 10px 3em !important;
height: 44px;overflow:hidden;
line-height: 1.5em;
}

Now, save your template by clicking on "Save Changes" You have added CSS style to your blog. and now its time for widget HTML/javascirpt code.

Go to Layout section of your blog, Click "Add a gadget" link then choose HTML/Javascript form the list. Copy and paste below code inside it.

<div id='random-posts'><script type='text/javaScript'>
var rdp_numposts=7;var rdp_snippet_length=0;var rdp_info='no';var rdp_current=[];var rdp_total_posts=0;var rdp_current=new Array(rdp_numposts);function totalposts(json){rdp_total_posts=json.feed.openSearch$totalResults.$t}document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&max-results=0&callback=totalposts\"><\/script>');function getvalue(){for(var i=0;i<rdp_numposts;i++){var found=false;var rndValue=get_random();for(var j=0;j<rdp_current.length;j++){if(rdp_current[j]==rndValue){found=true;break}};if(found){i--}else{rdp_current[i]=rndValue}}};function get_random(){var ranNum=1+Math.round(Math.random()*(rdp_total_posts-1));return ranNum};</script><script type='text/javaScript'>
function random_posts(json){for(var i=0;i<rdp_numposts;i++){var entry=json.feed.entry[i];var rdp_posttitle=entry.title.$t;if('content'in entry){var rdp_get_snippet=entry.content.$t}else{if('summary'in entry){var rdp_get_snippet=entry.summary.$t}else{var rdp_get_snippet="";}};rdp_get_snippet=rdp_get_snippet.replace(/<[^>]*>/g,"");if(rdp_get_snippet.length<rdp_snippet_length){var rdp_snippet=rdp_get_snippet}else{rdp_get_snippet=rdp_get_snippet.substring(0,rdp_snippet_length);var space=rdp_get_snippet.lastIndexOf(" ");rdp_snippet=rdp_get_snippet.substring(0,space)+"&#133;";};for(var j=0;j<entry.link.length;j++){if('thr$total'in entry);if(entry.link[j].rel=='alternate'){var rdp_posturl=entry.link[j].href;var rdp_postdate=entry.published.$t;if('media$thumbnail'in entry){var rdp_thumb=entry.media$thumbnail.url}else{rdp_thumb="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcNCrCRYTY3B1qk-UCLS3bBUvl3uprH8WEZxkp65aHMRIT_EjVuKgAWj7hKQYE8sa3-mqzlHpDO2Rr1waHIiJiwiiPrT320l11kwQnaIMpcgUmJjnUEmBhCtIxRK502pPHfsAAmAwRSA/s1600/default.jpg"}}};document.write('<li>');document.write('<img alt="'+rdp_posttitle+'" src="'+rdp_thumb+'"/>');document.write('<div><a href="'+rdp_posturl+'" title="'+rdp_posttitle+'">'+rdp_posttitle+'</a></div>');if(rdp_info=='yes'){document.write('<span>'+rdp_postdate.substring(8,10)+'/'+rdp_postdate.substring(5,7)+'/'+rdp_postdate.substring(0,4)+' - '+rdp_commentsNum)+'</span>'}document.write('<div style="clear:both"></div></li>')}};getvalue();for(var i=0;i<rdp_numposts;i++){document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&start-index='+rdp_current[i]+'&max-results=1&callback=random_posts\"><\/script>')};
</script></div>

Now, give your widget a title as you like and if you want to change the number of the post to be displayed just change in red colored number in above code.

Save your widget and you're done. Just refresh your blog and see how it actually working :)

Drop your questions and comments below.

Show each blogger post's featured image on index pages (Different than inserted into the post)

I am sure you have noticed in almost all WordPress blog, have each post's featured image on homepage, archive pages, category pages, index pages but not the image that inserted into the post. and the good news is that i have a trick to show the same featured images into blogspot blog too. Now, you will be able to set a particular featured image to each post in your blogger blog.
Note : It will be work only, if you are using auto read more hack JavaScript in your blog.


Till now in blogger we are using a javascript hack to show the first image of the post as featured image in the index pages, but after applying this method that i am going to share, In your blogger homepage, user will be able to see a featured image tag that will be disabled when a user comes into the post to read.

Well, i hope you got my point. Now if you would like to know more about this trick to apply on your blog, just read the following steps.

Also check : Add Background Color or Image in Blogger Posts Using CSS


First log-in with your blogger account. Simply click orange colored button with pencil icon for a new post. Normally write your post and add relevant pictures on it.


Now, before you publish the post, Choose a different featured image that you want to be displayed on index pages. that should be different image than already inserted into the post. Once you have chooses the featured image, you will need to resize the height and width as same as you have set in your javascript so that it look cooler.

Now, Switch to HTML tab. In the beginning, click and upload the featured image that you chooses to be displayed into homepage. (featured image must be placed at the beginning of the post. so that javascript can detect the image to be display.)


As you can see the in the screenshot above, it is how Image HTML code look like. There is an hyperlink that we will have to remove first. for an example see the following codes.

When you upload the image to your blogger post and Switch to the HTML tab it looks like this :

<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" target="_blank">
<img alt="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" /></a></div>

Now, remove the hyperlink form the image then it should be look like this :

<div class="separator" style="clear: both; text-align: center;">
<img alt="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" /></div>

Now, we will edit the CSS code of this image to hide it form the post page. to hide this image form the post page, all you have to do is to add display:none attribute to the image. here see the code below :

<div class="separator" style="display:none;clear: both; text-align: center;">
<img alt="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTvfzG5HuhyCwuaGfYneNj57sFa4tXo_mv1DNlZrIYHJVo0JGIYbqF8FntH4DBzA9E2YuRhLHMiq4e4V_0VbXLm1lWTVL3-3kD4jRnhOsIk1jt6YYJ32E2GBQ710pJbjAm5WKM4KaremE/s1600/Twitter-Buttons-73-13-.png" /></div>

Now, when you Switch back to the compose tab, you will be not able to see that featured image there as we have hidden by adding display:none attribute.

That's it. Now you can publish your article, and visit your blog's homepage. You will see that hidden image as featured image in your homepage and index pages. but not in post page. isn't it good?

Preview of Homepage :-

Preview of Post Page :-

Drop your comments and questions below :)

How to Create A Rollover Image Effect "Change image on mouseover"

Here in this article we will discuss on an another topic is that the rollover effect which is an image web object changes on mouse over to another web object "called rollovers" and reverts back to the original object on mouse out. Rollover images are preloaded into the page when it is loading. So, rollover will be displayed quickly even without loading the images. its working based on the attributes of the link tag onMouseOver and onMouseOut.

Also see : Add Flashing Christmas Lights in Blogger / Blogspot


Demo : Place your mouse over the image below to see its rollover effect.

How to make Rollover Effect Image

Here is an HTML code that you can use to make rollover effect image:

<a href="URL"><img src="IMG-1" onmouseover="this.src='IMG-2'" onmouseout="this.src='IMG-1'" /></a>

Change the colored texts as it follows:

1. URL

This is the URL/Link where somebody will be sent when clicks on the image.
Example, my blog URL/LINK: http://www.bloggerwidgetgenerators.com

2. IMG-1

Replace the red text (two times) with the URL address of the image which will appear before you hover over it.

3. IMG-2
Replace the text in blue with the url of  the image that will appear when the cursor hovers over it.

That's it.

Now you can use this rollover image to your blog's sidebar or new post. To add this image in sidebar navigate to the layout > Add a gadget > Choose HTML/Javascript form the list and paste the code inside in to show this widget in sidebar of your blog.

And to display this image to your new blog post, in your blog's post editor switch to the HTML tab and then paste the code anywhere you would like to show and you're done.

If you have any questions about this tutorial feel free to comment below, i would love to answer your each questions. Thank You :)