Smooth scrolling doesn't work
-
Hi guys,
Can you help me with smooth scrolling on my website. Script works but without smooth scrolling.
Website is under construction but you can try this on the menu below cover page: https://aplace.pl/video#Thanks in advance.
Best,
Alexander -
-
Hi @mariusjopen
This one:
<script>
jQuery(document).ready(function(){
jQuery('body').on('click', '#view-more', function(event) {
event.preventDefault();
var id = jQuery(this).attr('href');
jQuery('html, body').animate( { scrollTop: jQuery(id).offset().top }, 750, 'easeOutExpo' );
});
})
<script>Best,
Alexander -
Hi @mariusjopen,
Do you have any ideas how to solve this technical issue?
I'd be grateful for your help.Best,
Alexander -
Hi @PapaSasha
ok. Try this code here:
<script> jQuery(document).on("click", "#view-more", function(event) { event.preventDefault(); jQuery('html, body').animate({ scrollTop: jQuery("#view-more-anchor").offset().top }, 500); }); </script>
You need to make two divs of course. One with the ID
#view-more;
and the other one with the ID#view-more-anchor;
.In your code you also did not consider this:
http://laytheme.com/documentation.html#custom-javascriptBest!
Marius
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