Custom JS script not working after second page load
-
Hi @arminunruh / @mariusjopen
I've added this piece of script to toggle dark-mode in custom html/css :
<script> let element = document.getElementById("circle"); element.ondblclick = darkmode; function darkmode() { var element = document.body; element.classList.toggle("dark-mode"); } </script>It works fine the first time I load the page, but once I visit a new page and come back to my first page it does not work anymore.
Could you help me out with this?
Thanks! :)
Joseph
-
Hi @jsphbngrnd
Because LayTheme is written as a single-page Javascript application, some things work differently.
Here is the documentation :
http://laytheme.com/documentation.html#custom-javascriptHope you find what you are looking for :)
Many wishes,
Audrey
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login