history back button
-
Re: history back button
hello, I want to add a history back link. i don’t know any js, so this old post and what i found in the documentation for "binding click events" is not helping me. can you guide me trough the steps? -
hi
can u try this
put this in lay options -> custom css & html -> custom <head> content:<script> jQuery(document).on("click", ".back", function(event) { event.preventDefault(); event.stopPropagation(); history.back(); }); </script> <style> .back{ cursor: pointer; } </style>now in the gridder edit a text, open the code editor in the text and then on any html element add the class "back"
so for example:
<p class="back">hello</p>or right click an element in the gridder, choose set html class and id
and as a class add
back
-
hi
can u try this
put this in lay options -> custom css & html -> custom <head> content:<script> jQuery(document).on("click", ".back", function(event) { event.preventDefault(); event.stopPropagation(); history.back(); }); </script> <style> .back{ cursor: pointer; } </style>now in the gridder edit a text, open the code editor in the text and then on any html element add the class "back"
so for example:
<p class="back">hello</p>or right click an element in the gridder, choose set html class and id
and as a class add
back
@arminunruh works perfectly, thanks a lot!
-
Thank you @arminunruh this is just what I was looking for!
For paid 1-on-1 Lay Theme Coaching, contact Audrey (audrey@cyberslayers.work) or me (info@laytheme.com).
We also code custom websites or bespoke Lay features. Drop me a line at info@laytheme.com or check out my work at arminunruh.com.
Want to support my work? paypal.me/arminunruh
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it