View Full Version : Css Logo...
shernoam
09-01-2001, 02:59 PM
Hi!
I have a page the is loading random Css's...
so every time you visit the site you will have different colors...
The problem is that I have a logo that can be used only with one background color..
How can I load an appropriate logo with every css...
(how can I load a yellow logo with a yellow css, an orange logo with orange css.......)
thanks :D
(p.s. I think I need to write that in the css file)...
cloud9
09-01-2001, 03:34 PM
Originally posted by shernoam
Hi!
I have a page the is loading random Css's...
so every time you visit the site you will have different colors...
The problem is that I have a logo that can be used only with one background color..
How can I load an appropriate logo with every css...
(how can I load a yellow logo with a yellow css, an orange logo with orange css.......)
thanks :D
(p.s. I think I need to write that in the css file)...
Is the logo an image? then it should be easy, post your random CSS code for details :D
Dr. Web
09-01-2001, 04:44 PM
exactly... specify the image IN the css file you load. The yellow css file will call the appropriate yellow image.
COBOLdinosaur
09-01-2001, 07:12 PM
I will make an assumption that you are using like this to load the CSS:
<script language="JavaScript">
<!--
var thecss new Array("css1.css","css2.css","css3.css","css4.css","css5.css","css6.css")
var pntr=Math.round(Math.random()*5)
document.write('<LINK REL="Stylesheet" TYPE="text/css" HREF="'+thecss[pntr]+'">');
//-->
</script>
At least that is the way I would do it.
So do the logo the same way by putting the image file urls in an array and
then where you want the logo:
<script language="JavaScript">
<!--
document.write('<img src="'+theimage[pntr]+'" border=0>');
//-->
</script>
Just make sure you declare the pntr variable as global so you
can use the value wherever you need it.
shernoam
09-02-2001, 03:55 AM
Hi!
I have a page with frames so I have this in the main page (the one with the frameset):
<script language="JavaScript">
function randomRange(inMin,inMax) {
var min = 0, max = 0;
if (inMin) min = inMin;
if (inMax) max = inMax;
if (min > max) {
var swop = min
min = max
max = swop
}
return min + Math.floor(Math.random() * (max - min + 1))
}
function randomSheet() {
if (typeof(randomSheet.dice) == "undefined")
randomSheet.dice = randomRange(1,6);
var docName = "style.css";
if (randomSheet.dice == 1) docName = "bluestyle.css";
if (randomSheet.dice == 2) docName = "style.css";
var result = "<link rel='stylesheet' type='text/css' href='" + docName + "'>"
return result;}
document.write(randomSheet());
& in every other page (& frames) I have this:
<script Language="JavaScript">
document.write(top.randomSheet());
</script>
How the 'new' script should look?
thanks :p
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.