More than one color for the same website

Discussion in 'HTML & Website Design' started by ajkendall, May 30, 2007.

  1. #1
    Hi guys, not posted in here for a while, just wondering how this is achieved: i'm looking to have a website with the user having the option to change the entire color scheme at the click of a mouse

    for example, if i have a site that is beige colored by default, the user can click on either red or blue and the entire site will change to a red version etc

    a good example of this is on the http://www.msn.com/ website, they have a page options drop down box with the option of changing the color to blue, red, green etc

    i assume it changes the style sheet and what not but just wondering how i would go about doing it

    thanks in advance for any comments

    Alan :)
     
    ajkendall, May 30, 2007 IP
  2. Cesay

    Cesay Peon

    Messages:
    121
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use Ajax to do it or just about any server-side scripting language. If you google for ajax css switchers, you'll find lots of examples. :)
     
    Cesay, May 30, 2007 IP
  3. ajkendall

    ajkendall Active Member

    Messages:
    345
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    cheers cesay, i'll get onto it now and see what i can find, do you know if ajax is what msn use for my above example?

    :)
     
    ajkendall, May 30, 2007 IP
  4. luckybee

    luckybee Peon

    Messages:
    151
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I know you can do it with MooTools. Check out this demo for an example of what it does. If you need help implementing it, their forums are friendly.
     
    luckybee, May 30, 2007 IP
  5. ajkendall

    ajkendall Active Member

    Messages:
    345
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #5
    thanks for the reply luckybee but i'm looking for an easier way which i'm sure there is of achieving this, maybe some simple javascript and css
     
    ajkendall, Jun 4, 2007 IP
  6. pozmu

    pozmu Active Member

    Messages:
    190
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
  7. adsoncraigs

    adsoncraigs Banned

    Messages:
    145
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i would use PHP smarty templates to acheive that
     
    adsoncraigs, Jun 4, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PHP Smarty templates are unnecessary, and add more bloat than they're worth. A simple JavaScript or PHP based stylesheet switcher that stores a cookie on the user's computer to save the preference is better, uses less code, saves bandwidth and cuts down on the number of processes used by the server.
     
    Dan Schulz, Jun 5, 2007 IP
  9. ajkendall

    ajkendall Active Member

    Messages:
    345
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #9
    dan your spot on that's exactly what i'm looking to do... where can i learn how to do it?
     
    ajkendall, Jun 5, 2007 IP
  10. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #10
    www.alistapart.com has what you are looking for (a site search for "PHP stylesheet switcher" should get you a direct link) :)

    I really don't recommend ALA for a lot of things these days, but their stylesheet switchers (not to mention CSS Sprites) are top-notch.
     
    Dan Schulz, Jun 5, 2007 IP