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
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,
AlexanderHi @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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login