<HTML> <HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
function bkgrnd() {} ; bg = new bkgrnd () ; n = 0
bg[n++] = "images/Image1.gif"
bg[n++] = "images/Image2.gif"
bg[n++] = "images/Image3.gif"
bg[n++] = "images/Image4.gif"
bg[n++] = "images/Image5.gif"
//Just keep adding
rnd = Math.floor(Math.random() * n) ;
tmp = '<BODY BACKGROUND="' +bg[rnd]+ '"'
+' BGCOLOR="#FFFFFF">'
//--></SCRIPT></HEAD>
<SCRIPT LANGUAGE="Javascript"><!--
document.write( tmp )
//--></SCRIPT>
<script type="text/javascript">
/*Random Background Image-
By JavaScript Kit (www.javascriptkit.com)
More free JavaScripts here!
*/
var randombgs=["../clip/backgr4.jpg", "../clip/backgr17.jpg", "../clip/backgr13.jpg"]
document.body.style.background='white url('+Math.floor(Math.random()*randombgs.length)]+')')
</script>
<table style='background: url('آدرس تصوير');'>
document.getElementById('آي دي اون جدول').style.background='white url('+Math.floor(Math.random()*randombgs.length)]+')')
<HTML> <HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="Javascript"><!--
function bkgrnd() {} ; bg = new bkgrnd () ; n = 0
bg[n++] = "images/Image1.gif"
bg[n++] = "images/Image2.gif"
bg[n++] = "images/Image3.gif"
bg[n++] = "images/Image4.gif"
bg[n++] = "images/Image5.gif"
//Just keep adding
rnd = Math.floor(Math.random() * n) ;
tmp = '<table BACKGROUND="' +bg[rnd]+ '"'
+' BGCOLOR="#FFFFFF"></table'
//--></SCRIPT></HEAD>
<SCRIPT LANGUAGE="Javascript"><!--
document.write( tmp )
//--></SCRIPT>
ارادتمند دوستان، حسین سعیدی هستم...
نشد.
برای اینم باید id بدم؟
<table id='mytable'>
<tr>
<td></td>
</tr>
<table>
درود بر شما
برای نمایش اتفاقی عکس پس زمینه شما باید از جاوا اسکریپت استفاده نمایید:
روش دیگرHTML:<HTML> <HEAD><TITLE></TITLE> <SCRIPT LANGUAGE="Javascript"><!-- function bkgrnd() {} ; bg = new bkgrnd () ; n = 0 bg[n++] = "images/Image1.gif" bg[n++] = "images/Image2.gif" bg[n++] = "images/Image3.gif" bg[n++] = "images/Image4.gif" bg[n++] = "images/Image5.gif" //Just keep adding rnd = Math.floor(Math.random() * n) ; tmp = '<BODY BACKGROUND="' +bg[rnd]+ '"' +' BGCOLOR="#FFFFFF">' //--></SCRIPT></HEAD> <SCRIPT LANGUAGE="Javascript"><!-- document.write( tmp ) //--></SCRIPT>
HTML:<script type="text/javascript"> /*Random Background Image- By JavaScript Kit (www.javascriptkit.com) More free JavaScripts here! */ var randombgs=["../clip/backgr4.jpg", "../clip/backgr17.jpg", "../clip/backgr13.jpg"] document.body.style.background='white url('+Math.floor(Math.random()*randombgs.length)]+')') </script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 5</title>
<script language="JavaScript" type="text/JavaScript">
var backgroundImages=new Array(5);
backgroundImages[0]="background1.gif";
backgroundImages[1]="background2.gif";
backgroundImages[2]="background3.gif";
backgroundImages[3]="background4.gif";
backgroundImages[4]="background5.gif";
onload=function(){
var e=(document.getElementById)?document.getElementById("myTableId"):(document.all)?document.all.myTableId:(document.layers)?document.myTableId:null;
if(!e)return true;
e.style.backgroundImage="url("+backgroundImages[Math.floor(Math.random()*backgroundImages.length)]+")";
}</script>
</head>
<body>
<table id="myTableId" width="700" height="400" border="0" cellpadding="0" cellspacing="0">
</table>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 5</title>
<script>
<!---Copyright John Baldock - http://website.lineone.net/~jbonno--->
function randomcolour()
{
colour_array = new Array();
colour_array[0] = 'RED';
colour_array[1] = 'BLUE';
colour_array[2] = 'GREEN';
colour_array[3] = 'YELLOW';
<!--- THE ABOVE ARRAY CAN BE ANY LENGTH AND CAN USE HEX VALUES INSTEAD OF COLOUR NAMES --->
count = colour_array.length;
random = Math.floor(Math.random() * count);
document.getElementById('maintable').style.background = colour_array[random];
}
onload=randomcolour;
</script></head>
<body>
<table id="maintable">
<!--- TABLE DATA --->
</table></body>
</html>