The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

css style picker ?

  • # February 21, 2013 at 12:25 pm

    hello everyone

    can you tell me how could I code a script or any other way that let the visitor choose his css style

    for example if he click a blue button the whole page will use a css that specify the blue color for elements etc.

    # February 21, 2013 at 12:28 pm

    There are quite a few…

    Try googling jQuery CSS Switcher

    # February 21, 2013 at 1:10 pm

    You can make your own easily enough. All you need to do is attach an `id` to the link element and switch the `href` to which it links to the location of a different file.In terms of getting the values to switch it to, you could create a `select` tag with the value for each `option` defined as a different page. An example of this form could be:



    Then you can latch onto what has been selected:

    $(‘#style-selector”).on(‘change’, function() {
    $(‘link’).attr(‘href’, $(“style-selector”).val() );

    Nice clean solution that you can expand as needed without having a bunch of features you may not need!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed