Link to a section with scroll to top button effect
-
Hi @Nicolas
does this answer your question?
http://laythemeforum.com:4567/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.
-
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