Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    history back button

    General Discussion
    2
    3
    21
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Piapia last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • arminunruh
        arminunruh Global Moderator last edited by

        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

        P 1 Reply Last reply Reply Quote 0
        • P
          Piapia @arminunruh last edited by

          @arminunruh works perfectly, thanks a lot!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Post a link to where the problem is
          I don't answer or check forum DMs, please just post on the forum.
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com

          Before you post:

          Use the Search Feature. Maybe there is already a solution to your issue.

          1. Update Lay Theme and all Lay Theme Addons
          2. Disable all Plugins
          3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
          4. Now see if your problem solved itself
          5. Go here, see if your problem is listed here:
          Troubleshooting

          When you post:
          1. Post a link to where the problem is
          2. If the problem is difficult to explain, post screenshots / link to a video to explain it

          Thanks!

          Online Users

          A

          Recent Topics

          • A

            With the updates my site has become very slow sloooooow

          • A

            thanks for the update ...

          • A

            Disable Rightclick and context menu for copyright reasons

          • A

            back to home from any project should not go back to top at home

          laytheme.com