Random Images for Blogger Header (Blogspot) with Every Page Visit (Refresh)

random banners for blogger header

This is really cool trick for random your Blogger header with every page refresh (visit). May be it's another simple tip for boost your adsense earning. In this post I will explain how to customize the blogger header for random images.

How to add this tweak to blogger template?
There're two methods. First thing you have to select few banner images and get the url of uploaded pictures. After this follow below instructions.

First method :

01. Now go to your blogger Design, Edit HTML and click on Expand Widget Templates

02. Now search for following piece of code in your template }]]></b:skin> and paste below java script after this.


Second method :

01. Now go to your blogger Design, Page Elements , Add a Page Element select HTML/JavaScript , add below java script and save it.

Don't forget fill with your background image url with "Image01URL to Image09URL". Should be nine different image url.

Random header background java script.

<script type="text/javascript">
var banner= new Array()
banner[0]="Image01URL"
banner[1]="Image02URL"
banner[2]="Image03URL"
banner[3]="Image04URL"
banner[4]="Image05URL"
banner[5]="Image06URL"
banner[6]="Image07URL"
banner[7]="Image08URL"
banner[8]="Image09URL"
banner[9]="Image10URL"
var random=Math.floor(10*Math.random());
document.write("<style>");
document.write("#header {");
document.write(' background:url("' + banner[random] + '") no-repeat top left;');
document.write(" }");
document.write("</style>");
</script>


Now you're done, now you can see random background image for your blogger header with every page refresh.

Related Posts



0 comments: