Friday, May 20, 2011

How To Make Image Header Rotate or Change When Other Tab Clicked

STEP 1 : Go to Dashboard > Edit HTML
STEP 2 : Find the code
press Ctrl + F at the same time, and then find the code below:
</head>
STEP 3 : Paste this code above </head>
<script type="text/javascript">


var banner= new Array()


banner[0]="http://2.bp.blogspot.com/_UtQyNOQGaVM/TSgYRYf0OcI/AAAAAAAADZc/b-zM4APZ8EU/s1600/1.png"
banner[1]="http://4.bp.blogspot.com/_UtQyNOQGaVM/TSgYasrA85I/AAAAAAAADZg/Rh0TkBfrPM0/s1600/2.png"
banner[2]="http://3.bp.blogspot.com/_UtQyNOQGaVM/TSgY0up_nhI/AAAAAAAADZk/pqk2LBBtx0g/s1600/3.png"
banner[3]="http://1.bp.blogspot.com/_UtQyNOQGaVM/TSgY6_9kF0I/AAAAAAAADZo/XFWGMfV8WU8/s1600/4.png"
banner[4]="http://3.bp.blogspot.com/_UtQyNOQGaVM/TSgY0up_nhI/AAAAAAAADZk/pqk2LBBtx0g/s1600/3.png"
var random=Math.round(4*Math.random());


document.write("<style>");
document.write("#header {");
document.write(' background:url("' + banner[random] + '") no-repeat left TOP;');
document.write(" }");
document.write("</style>");


</script>
STEP 4 : Change the highlighted code in RED with your photo URL from photobucket or where ever it is from. Save your template and your done. If you wish to reduce the images showing just simply delete the your photo URL that you want to be deleted and change the number you see after the banner. It is normally counted [0] to [5] if you got 6 images rotating and also change the var random.

see live demo : ROTATING IMAGES WHEN TAB CLICK
Related Posts Plugin for WordPress, Blogger...