Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post

    Let the user select the css stylesheet

    Hi there,

    Is there any way that i can make something that goes on my site in every page, where the user clicks on a selected style and it will use a seperate stylesheet.

    Eg: A user wants my site in red, so they click on the red style and it will use only parts of a seperate stylesheet. So it changes the background to red, but still reads the old stylesheet but everything i put in the red stylesheet it will use and overwrite what it says in the old stylesheet.

    This way the user will be able to choose what style they like my site in.

    Also, is there any way it can make a cookie and store it so that the next day when they go back to my site, it will display the same style that they chose the previous day?

    Is there any way to do this using php or javascript?


  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes.

    You want a stylesheet switcher.

    Avoid scripts found on DynamicDrive.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    Ok,

    I have had a look at this one...

    http://www.alistapart.com/stories/alternate/

    And i can't get it to work on my site?

  • #4
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You set the rel attributes wrong in two of the <link> elements.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #5
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    Ok thanks,

    But i have followed a different turorial now and its all done with php.

    It works fine. I am still working on it, but it works on the home page.

    Have a look at http://www.allsortshop.com

    Thanks!


  •  

    Posting Permissions

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