––––•(-•== Cyber Nirwana NET Forum :: Bersama Berbagi Ilmu ==•-)•––––
 
IndeksIndeks  PortalPortal  FAQFAQ  PencarianPencarian  AnggotaAnggota  GroupGroup  PendaftaranPendaftaran  LoginLogin  

Share | 
 

 _Animated primary photo_

Go down 
PengirimMessage
=-_N'c3LL_-=
Moderator
Moderator
=-_N'c3LL_-=

Jumlah posting : 71
Join date : 05.06.08
Age : 25
Lokasi : PEGUNUNGAN

PostSubyek: _Animated primary photo_   Thu Jun 05, 2008 2:34 pm

Ini hanya trick agar primary poto di fs kita berganti ganti secara beracak..


Ini Code'nya :

======================================================================
//Animated Primary Photo

if (!attachOnLoadHandler(function() { randImage();})) window.onload = function() { randImage();};
function randImage() {
RANDOMIMG.init();
}

if (typeof RANDOMIMG == "undefined") { RANDOMIMG = {}; }
RANDOMIMG = {
image: [],
sibling: [],
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 PHOTO1";
this.randimage[1] = "URL PHOTO2";
this.randimage[2] = "URL PHOTO2";
this.randimage[3] = "URL PHOTO4";
this.randimage[4] = "URL PHOTO5";
this.randimage[5] = "URL PHOTO6";

this.image = document.createElement("DIV");
this.image.setAttribute("class","randImg");
this.image.innerHTML = "<img name=\"defaultimage\" width=\"200\" height=\"250\" src=\""+this.randimage[Math.floor(Math.random()*(this.randimage.length))]+"\">";
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.images.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;
}
};
====================================================================

Ganti url photo 1 sampai 6 dengan url photo kaliian .

Jgn Lupa Save Dengan External'nya JS iia . !!!


ok brot ....


selamat Mencoba !!!!




lol!


Terakhir diubah oleh =-_N'c3LL_-= tanggal Thu Jun 05, 2008 3:58 pm, total 1 kali diubah
Kembali Ke Atas Go down
Lihat profil user
h3ndyn01z3
Admin
Admin
h3ndyn01z3

Jumlah posting : 113
Join date : 04.06.08

PostSubyek: Re: _Animated primary photo_   Thu Jun 05, 2008 3:46 pm

itu di inject ke CSS external, internal, apa ke JS..??? Question

_________________
•·.·΄―`·.·•(-•Selamat Datang Di Dunia Cyber•-)•·.·΄―`·.·•

Kembali Ke Atas Go down
Lihat profil user http://cyber-community.forumakers.com
=-_N'c3LL_-=
Moderator
Moderator
=-_N'c3LL_-=

Jumlah posting : 71
Join date : 05.06.08
Age : 25
Lokasi : PEGUNUNGAN

PostSubyek: Re: _Animated primary photo_   Thu Jun 05, 2008 3:57 pm

h3ndyn01z3 wrote:
itu di inject ke CSS external, internal, apa ke JS..??? Question


hihihih ...

sory saiia lupa untuk ingatkan .


ubah'nya ke JS iia . !!!


Soryy .
Kembali Ke Atas Go down
Lihat profil user
Sponsored content




PostSubyek: Re: _Animated primary photo_   

Kembali Ke Atas Go down
 
_Animated primary photo_
Kembali Ke Atas 
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
CLOSED :: Aktif Zone :: Friendster Tweak-
Navigasi: