Label Cloud

Search This Blog

07 March 2010

online counter Membuat Random Background

Assalamualaikum , Msue ingin berkongsi bagaimana cara hendak membuat random background .DEMO Korang refreshkannya untuk melihat hasilnya .

1. Login ke Blogspot .

2. Klik Layout -Add A Gadget- HTML/Javascript .

3. Copy javascript:void(0)kod di bawah dan pastekan ke dalamnya .




<script type="text/javascript">
var background= new Array()
background[0]="http://2.bp.blogspot.com/__hqk0jmhlcE/Szpi-LapvZI/AAAAAAAAAH8/7H1NoxW__QY/s200/woodbg.jpg"
background[1]="http://2.bp.blogspot.com/__hqk0jmhlcE/Szpi9hnbQGI/AAAAAAAAAH0/1G1sK0L9xms/s200/vector-seamless-hearts-background-09-by-dragonart.png"
background[2]="http://1.bp.blogspot.com/__hqk0jmhlcE/SzphZJl8JDI/AAAAAAAAAGk/Lasnd3ieOVc/s200/Vintage-Pattern_Black.png"
var random=Math.floor(3*Math.random());
document.write("<style>");
document.write("body {");
document.write(' background:url("' + background[random] + '") repeat top center;');
document.write(" }");
document.write("</style>");
</script>


4. Save dan View


Note:Pada highlight , korang tukarkan ngan url image background yang korang nak .



Via - NescafeAis




Tinggalkan Komen Anda Disini