/    Sign up×
Community /Pin to ProfileBookmark

Script for random background in table…[help]

Hallo there,
iam looking for the script, that randomly sets background images in table without affecting other backgrounds on the page:
For example, i need a page that has its own background picture + that page schould have couple of tables with different background images and one “special” table with the randomly set background.

I have found some “background scripts” on i-net, but i coudnt make them to work a way i need (above):
[url=http://javascript.internet.com/bgeffects/r-images.html]changes background in Body tag[/url]

could somebody help me with it?
tnx

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63May 27.2003 — Take a looksy..may be this will help you..

:p

http://68.145.35.86/skills/javascripts/RandomBGImageInTables.html
Copy linkTweet thisAlerts:
@koeniepoenieMay 27.2003 — maybe this will help?

<body bgcolor="#FFFFFF" text="#000000" Onload="randbg('numb1');">

<table>

<tr>

<td id='numb1' bgcolor="#009933">koen

in da house</td>

</tr>

</table>

<script language="Javascript" type="html/javascript">

function randbg(id) {

var img = new Array('1.gif','2.gif'); // add your images here..

var num = Math.round(Math.random() * (img.length - 1));

var pic = img[num];

eval(id+".background = '"+pic+"';");

}

</script>

</body>

grtz Koen
Copy linkTweet thisAlerts:
@_dash_authorMay 27.2003 — Thanks a lot khalidali63,

that was the thing i was looking for ?
Copy linkTweet thisAlerts:
@koeniepoenieMay 27.2003 — haha

just 2 minutes.. sorry khalidali63 I didn't see your post ?

grtz Koen
Copy linkTweet thisAlerts:
@khalidali63May 27.2003 — You are welcome .dash

?
×

Success!

Help @_dash_ spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...