0

Here is what my website does:

So I'm using a basic jQuery method "addclass" like so:

   $( "body" ).addClass( "orange-background-color" );

   .orange-background-color {
        background: orange;
    }

The user has the option to click on an icon in the navigation menu to change the background of the site to orange.

Easy enough.

But...if the user is on the home page and then goes to the about page, how can I "keep" the new body class on the about page too, without the user have to re-click the icon in the menu?

Michael Sebastian
  • 785
  • 3
  • 15
  • 33
  • 1
    I think [this](http://stackoverflow.com/questions/29986657/global-variable-usage-on-page-reload) article is relevant to your question. – Rick Runowski Jun 16 '16 at 14:07

1 Answers1

1

Having the value in the session is harder for you. You should keep on checking this session is exists or not while loading the each page like login session is exists or not and act accordingly. But no other way :-)

Premanand K
  • 632
  • 8
  • 18