Links to Content on Same Page
-
Hey kian!
Please update to the latest lay theme 1.9.7
Now right click an element or row where you want your button to scroll to. Choose "Set HTML class and id". Now type in an id, for example:
myid
Now create a textelement, write a word, select the word, click the "link" button and as the link-target type in:
#myid
This is the standard html way to do this ( standards are good :) ). Now you probably wanna have a scroll animation for that. You can use this javascript for that.
Enter it in "Lay Options" -> "Custom CSS & HTML"
<script> jQuery(document).on("click", "a[href*=#]", function(e){ e.preventDefault(); var targetId = jQuery(this).attr("href"); jQuery('html, body').animate({ scrollTop: jQuery(targetId).offset().top, }, { duration: 2000, easing: "easeOutSine" }); }); </script>
You can also choose another easing of these listed here in "example" http://gsgd.co.uk/sandbox/jquery/easing/
-
@arminunruh thanks for also teaching us some coding basics :blush:
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
Online Users
Forgot your key, lost your files, need a previous Lay Theme or Addon version?
Go to www.laykeymanager.com