Custom JS script not working after second page load
General Discussion
2
Posts
2
Posters
266
Views
-
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
Online Users
Forgot your key, lost your files, need a previous Lay Theme or Addon version?
Go to www.laykeymanager.com