PDA

View Full Version : I am new to this.



Webbie
01-11-2006, 03:50 AM
I have a logo with a leaf for the dot in an i. I can change the color of the leaf either seperately from the rest of the logo by using two tif's or I can chage it on each single tif.
My question is, when people come in to the site or change a page with in the site, how can it bring up a random different colored logo?
Does that make sense???
I don't know much about web design.
Thanks for any help.
Dave

jscheuer1
01-11-2006, 06:18 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<script type="text/javascript">
var logo=["photo1.jpg", "photo2.jpg", "photo3.jpg", "photo4.jpg"]
logo.sort(function() {return 0.5 - Math.random();})
document.write('<img src="'+logo[0]+'">')
</script>
</body>
</html>

Webbie
01-11-2006, 09:33 PM
This is what the code is currently, I tried yours, which I am sure is right, however I must not have done something right.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<title>Winchester Gardens</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="wrapper">
<div id="logo">
<div id="logoName"><img src="images/logo.gif" alt="logo name" width="220" height="90"></div>
<div id="address"><br />
</div>

jscheuer1
01-12-2006, 06:21 AM
My example code had a small error in it which was not fatal but, I have corrected it in the previous post anyway. Also, javascript is required for this to work, I am adding a bit that will give non-javascript enabled browsers something to display. Using what you have, you could adapt it like so:


<div id="logoName">
<script type="text/javascript">
var logo=["images/logo.gif", "images/logo2.gif", "images/logo3.gif", "images/logo4.gif"]
logo.sort(function() {return 0.5 - Math.random();})
document.write('<img src="'+logo[0]+'" alt="logo name" width="220" height="90">')
</script>
<noscript><img src="images/logo.gif" alt="logo name" width="220" height="90"></noscript>
</div>

You just need to have the images mentioned for the variable logo in the images directory. You can use less:


var logo=["images/logo.gif", "images/logo2.gif"]

or more:


var logo=["images/logo.gif", "images/logo2.gif", "images/logo3.gif", "images/logo4.gif", "images/logo5.gif"]

Four is a good minimum number, if you want some variability. Remember though, this is random, so the same one can come up repeatedly.

Webbie
01-17-2006, 02:43 AM
is this how I am supposed to put it in?


<body>
<div id="wrapper">
<div id="logo">
<div id="logoName"><script type="text/javascript">
var logo=["images/logo.gif", "images/logo2.gif", "images/logo3.gif"]
logo.sort(function() {return 0.5 - Math.random();})
document.write('<img src="'+logo[0]+'" alt="logo name" width="220" height="90">')
</script>
<noscript><img src="images/logo.gif" alt="logo name" width="220" height="90"></noscript>
</div></div>
<div id="address"><br />
<br />
</div>

jscheuer1
01-17-2006, 04:36 AM
Looks good! How about giving us a link to the page?

Webbie
01-22-2006, 01:15 AM
That might help, I told you I wasn't too bright...duhhhh.

www.wgardens.com (http://www.wgardens.com/)

jscheuer1
01-22-2006, 09:08 AM
I meant the one with the script on it.

Webbie
01-22-2006, 07:10 PM
I am sorry, I am not sure I know what you mean. I thought you meant so you could view source.
I am confused, sorry, BTW thanks for helping me.

jscheuer1
01-23-2006, 04:25 AM
Ya, I'd like to view the source but, a version of it with the code I provided for you used to the best of your ability. So I can trouble shoot it for you, if need be. Hopefully, you will learn more if you at least attempt to put the code into practice live.

Alivia74
01-23-2006, 06:51 AM
[QUOTE=Webbie]



For heaven's sake, stop writing about "url" already!





[URL="http://www.local-cottages.info/denmark-cottages.html"]Denmark Cottages
(&quot;http://www.[/QUOTE) - Philadelphia flowers
(http://www.flowers-all-over-the-world.com/pennsylvania-philadelphia-flowers.html)