Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: I am new to this.

  1. #1
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I am new to this.

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <!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>
    Last edited by jscheuer1; 01-12-2006 at 07:00 AM. Reason: Closing Head Tag was in the body
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default What I have now

    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>

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <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:

    Code:
    var logo=["images/logo.gif", "images/logo2.gif"]
    or more:

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I still cant get it to work....

    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>

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looks good! How about giving us a link to the page?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That might help, I told you I wasn't too bright...duhhhh.

    www.wgardens.com

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I meant the one with the script on it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I am sorry

    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.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •