Get a free trial // Grow your CSS skills // Land your dream job

Adding new element to style changer

  • # February 10, 2013 at 3:24 pm

    Hello to everyone!

    I have a javascript stylechanger which changes layout from wide to boxed version and changes colors and patterns in my pages.

    now I have 4 types of to top buttons and want to add it to this changer.

    my totop class is “.totop” and it’s ids is “#v1”, “#v2”, “#v3” and “#v4”.
    how can I touch the codes below to change to top button via style changer?
    the hole javascript code is this:

    # February 13, 2013 at 12:06 pm

    I think it can be done by a javascript coder.

    I will wait again for your help.


    # February 13, 2013 at 12:09 pm

    >I think it can be done by a javascript coder.

    Your pen has no HTML or CSS…is this intentional?

    I have very little skills in JS but it seems to me that this could all be done with a css stylesheet switcher.

    # February 13, 2013 at 12:26 pm

    I have one at home (out now) that gives the body a new class with each style. So you can cascade the css and have multiple styles. Ill post it later

    # February 13, 2013 at 1:12 pm

    You want the to top button styled based on your current body class like ‘wood’? That would be possible in css as mentioned… like `.wood #v1 { display:none; }` maybe? Also your JS is very repetitive :P Allow me to rewrite it (be right back!)

    # February 13, 2013 at 1:43 pm

    There it is :) Couldn’t get the cookie plugin to work.

    # February 13, 2013 at 5:12 pm

    thanks you very much. now it’s working.

Viewing 7 posts - 1 through 7 (of 7 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