Link to a section with scroll to top button effect
-
-
Hi @Nicolas
does this answer your question?
http://laythemeforum.com/topic/2863/link-to-anchor-from-another-page/4Best!
Marius
-
Hi @mariusjopen
I think it's the idea, but i want to do that in the same page :
1- i put an image and i make an id (like hello)
2-i have a text link in this page (at the top for exemple) and in the link url i write this : http://mysite/#hello
3-when i click on this text link i want to go to the image with smooth scroll effet :)It is possible? Here is my website with the menu with links which refers to the images (but not with smooth effect): http://druidhigh-visuals.com
Thanks!
-
Dear @Nicolas
have a look here:
http://jsfiddle.net/kevinPHPkevin/8tLdq/1/And consider this:
http://laytheme.com/documentation.html#custom-javascriptIt won't be that difficult :-)
Best!
Marius
-
Hi @mariusjopen
It's works! :D Thank you very much.
Here's how I did it with the help of your links:window.laytheme.on("newpageshown", function(layoutObj, type, obj){ jQuery("#button").click(function() { jQuery('html, body').animate({ scrollTop: jQuery("#myid").offset().top }, 2000); }); });for now this code works on a single id and link. I will try to adapt it to do this on several different links and ids.
-
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