Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Toggle Page Color

Rishi Dec 14, 2018 05:07PM CET

Hello! Is there a way to create a button that toggles the background color of a page? I'd like to change a white page to a black page using a button. I I know that you can change the page color using the "Branding" section but I would like visitors the option to change the page color themselves (for reading at night). Is this possible?

Up 0 rated Down
Jon Dec 14, 2018 10:10PM CET Semplicelabs Agent

Hey Rishi!

Unfortunately, we can’t assist with custom code support for something like this since it’s not native to Semplice, and unfortunately we’re too small of a team to offer customized support (we’re a small crew!)

That being said, you may be able to use some simple jQuery to set a click event on a Semplice button or link, and then change the ‘body’ (or any section of your page with a custom class in your Section Styles) background color. You can follow this link for example code:

https://www.w3resource.com/jquery-exercises/jquery-events-exercise-8.php

I’m sorry I can’t assist beyond this, but hope it helps.
Jon

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
17c96688a1a336f6040dd1b6149c3fa8@semplicelabs.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete