Shoutbox

changing backgrounds in html? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: changing backgrounds in html? (/showthread.php?tid=48429)

changing backgrounds in html? by marissa on 08-03-2005 at 03:25 AM

is there a code or something that'll change your background on something in HTML nothing else, but i was just wondering. Probably not, since html is just basic stuff...but you never know. i just want to know so i can have an alternating background on my myspace (NOT msn's my spaces >.<)


RE: changing backgrounds in html? by ShawnZ on 08-03-2005 at 03:28 AM

two ways, im sure both don't work in your case.

<style>body{background:url("http://new/background.png");}</style>

orrrrrr

<script>document.body[0].background = "http://new/background.png"</script>


RE: changing backgrounds in html? by marissa on 08-03-2005 at 03:42 AM

oh crap, maybe i worded that wrong..
like i want...say, a blue background *the person refreshes* a red background *refresh* a green background...etc. or would those codes still work? i dont know.


RE: changing backgrounds in html? by YottabyteWizard on 08-03-2005 at 03:50 AM

Dont know the code but im pretty sure javascript does the trick....


RE: changing backgrounds in html? by DJeX on 08-03-2005 at 03:59 AM

You need a javascript code that would randomly pick the background color on page load.


RE: changing backgrounds in html? by ShawnZ on 08-03-2005 at 04:00 AM

* ShawnZ claps for the people that told her what to do but not how to do it


RE: changing backgrounds in html? by marissa on 08-03-2005 at 04:06 AM

haha yeah, but atleast they didnt waste their time :p. MySpace doesnt support java code...losers :rolleyes:


RE: changing backgrounds in html? by matty on 08-03-2005 at 04:10 AM

code:
<!-- TWO STEPS TO INSTALL RANDOM COLORS:

   1. Paste the first code into the HEAD of your HTML document
   2. Put the last coding into the BODY of your HTML document  -->
       
<!-- STEP ONE: Paste this code into the HEAD of your document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function rnd(scale) {
var dd=new Date();     
return((Math.round(Math.abs(Math.sin(dd.getTime()))*1000000000)%scale));
}
function show() {       
document.blah.bg.value=document.bgColor;       
document.blah.fg.value=document.fgColor;
}
document.fgColor=256*rnd(255)+16*rnd(255)+rnd(255);
document.bgColor=256*rnd(255)+16*rnd(255)+rnd(255);
// End -->
</SCRIPT>

<!-- STEP TWO: Paste this coding into the BODY of your HTML document  -->

<BODY>

<CENTER>
<a href="javascript:history.go(0)">Click here to get new colors</a>
</center>
<FORM name=blah>
<table border=0 width=100%><tr><td align=left>Foreground color</td>
<TD align=right>Background color</TD>
</TR>
<TR>
<TD align=left>
<input type=text name=fg>
</TD>
<TD align=right>
<input type=text name=bg>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.28 KB  -->

RE: changing backgrounds in html? by surfichris on 08-03-2005 at 04:12 AM

quote:
Originally posted by marissa cool
HTML nothing else
quote:
Originally posted by marissa cool
MySpace doesnt support java code.
I decided i'd leave off the losers part (A)
RE: changing backgrounds in html? by marissa on 08-03-2005 at 04:14 AM

oh, i wasnt calling them losers :) I was calling myspace losers for not being able to use java, but i guess that's good in a way. it would muck peoples pages up to the point of...no return! dun dun dun