Is it true
that you are willing give something new to your blogger users every time they
visit your blog? So, today with the help of little CSS trap we will help you to
change the background shade / color of your blog each time a people visits or
reloads a page on your blogger website. Now, let’s see
How to Automatically Change Background color in Blogger
These are
the following steps to change automatically background color in blogger blog:
Step # 1: Login to your blogger blog account
Step # 2: Go to your blogger dashborad and click on Template > Edit HTML
Step # 3: Now click anywhere in blogger template and Press Crl+F and find </head> tag in blogger template code and copy the following code and paste above the </head> tag.
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>Note: If template already added a jquery.min.js file then don't add the following line of code in your template because this will cause things to not work.
<script type='text/javascript'>//<![CDATA[
function get_random_color(){var e="0123456789ABCDEF".split("");var t="#";for(var n=0;n<6;n++){t+=e[Math.round(Math.random()*14)]}return t}$(function(){$(".post").each(function(){$(this).css("background-color",get_random_color())})})//]]></script>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>Last Step # Save Template.
Done. I hope this post become useful in your knowledge.
0 comments:
Post a Comment