View Single Post
Sponsorlu Bağlantılar
Zoque.Forum
Advertisement
Old 18.09.2007   #3 (permalink)
TUNGA
 
Üyelik Tarihi: 01.03.2007
Yer: Bursa
Yaş: 33
Mesaj: 16
Re: rastgele değişen arkaplan resimleri! ama nasıl?

Merhaba,

umarim isinizi gorur:

Kod:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<head>
	<title>Untitled</title>
</head>

<body >
<script type="text/JavaScript">
function init() {
	bg_img = new Array("a.jpg", "b.jpg", "c.jpg");
	len = bg_img.length;
	rand = Math.round((len-1)*Math.random());
	document.getElementById('bg').style.background = 'url('+bg_img[rand]+')  no-repeat top center';
}
	if(window.attachEvent){
    	window.attachEvent("onload", init);
	} else if(document.addEventListener || window.addEventListener){
    	if(document.addEventListener){
	        document.addEventListener("load", init, false);   
    	}
	    if(window.addEventListener){
    	    window.addEventListener("load", init, false); 
		}
	} else {
    	if(typeof window.onload == "function"){
	        var _old = window.onload;
    	    window.onload = function(){ _old(); init(); };
	    } else {
    	    window.onload = init;
	    }
	}
</script>
<div id="bg" style="width:100%; height:100%;"></div>

</body>
</HTML>
Kolay Gele ...
Mesut TUNGA ...
TUNGA şu an çevrimdışı   Mesajdan alıntı yaparak yeni bir cevap ekleyin