[bLaCk-HoL3] Hikari Master
Jumlah posting : 249 Reputation : 0 Join date : 2008-04-18 Age : 34 Lokasi : Manado City
| Subject: Random Photo primari ^^ Mon Jun 30, 2008 8:03 am | |
| Ok Langsung Ke TKP aja yah :D:D - Spoiler:
/******** random foto primary*********/
if (typeof RANDOMIMG == "undefined") { RANDOMIMG = {}; } RANDOMIMG = { image: null, sibling: null, randimage: [],
init: function() { var preload = []; for (var n=0;n<this.randimage.length;n++) { preload[n] = []; preload[n].setAttribute("src",""+this.randimage[n]+""); } this.randimage[0] = "URL photo 1"; this.randimage[1] = "URL photo 2"; this.randimage[2] = "URL photo 3"; this.randimage[3] = "URL photo 4";
this.image = document.createElement("div"); this.image.className = "randomImage"; var rotateimg = document.createElement("img"); rotateimg.id = "defaultimage"; rotateimg.style.width = "200px"; rotateimg.style.height = "200px"; rotateimg.src = this.randimage[Math.floor(Math.random()*(this.randimage.length))]; this.image.appendChild(rotateimg); this.sibling = this.getModuleByClassName(/imgblock200/i)[0];
this.sibling.parentNode.replaceChild(this.image,this.sibling); setInterval("RANDOMIMG.rotateimage()", 2*1000); },
rotateimage: function() { var ind = 0; if (ind == (temp = Math.floor(Math.random()*(this.randimage.length)))) { ind = (ind == 0) ? 1 : ind - 1; }else { ind = temp; } document.getElementById("defaultimage").setAttribute("src",""+this.randimage[ind]+""); },
getModuleByClassName: function(sClass) { var elm = []; var els = document.getElementsByTagName("*") || document.all; for (var j=0,k=els.length;j<k;j++) { if (new RegExp(sClass).test(els[j].className))elm.push(els[j]); } return elm; } };RANDOMIMG.init();
Ket: ~Save In Extension.js ~yg waRna biru taroh dengan URL Photo km Corry Nich ngga ada priViewx | |
|
diansari Hikari Old
Jumlah posting : 359 Reputation : 0 Join date : 2008-06-24 Age : 35 Lokasi : _gak ada tempat_
Status Race: Baby Class: Newbie
| Subject: Re: Random Photo primari ^^ Tue Jul 15, 2008 3:23 pm | |
| wahh.. mantap bro codenya sip doble posting bro makasih bro | |
|
[bLaCk-HoL3] Hikari Master
Jumlah posting : 249 Reputation : 0 Join date : 2008-04-18 Age : 34 Lokasi : Manado City
| Subject: Re: Random Photo primari ^^ Wed Jul 16, 2008 4:46 am | |
| ok thanks ya neng :D:D | |
|
Sponsored content
| Subject: Re: Random Photo primari ^^ | |
| |
|