- This topic has 7 replies, 2 voices, and was last updated 8 years, 7 months ago by Sakin.
-
AuthorPosts
-
September 9, 2015 at 9:57 am #66487matthewseanmclachlanParticipant
Hi Sakin,
I would like to know how to make it so that when someone clicks on Projects on the header, the screen scrolls down to projects on the same page?
Thanks!
MattSeptember 9, 2015 at 6:16 pm #66531SakinKeymaster@matthewseanmclachlan: This is not one page theme for that. But if you want to link that way, you can use custom link with anchor with post ID. For example, http://www.trendfly.org/#post-44 will link to your project page. To add custom link in menu, see this screenshot https://www.pinterest.com/pin/548594798331771327/
September 10, 2015 at 6:19 am #66607matthewseanmclachlanParticipantI did what you suggested and it works, but how is it there is a scroll up option on the theme? Wouldn’t what I’m asking be similar to that?
Thanks!
MattSeptember 10, 2015 at 9:46 am #66619SakinKeymaster@matthewseanmclachlan: Scroll up is also doing same. It links to #page which is top of your page. It also have Javascript to make it smooth scroll and show/hide.
September 10, 2015 at 9:54 am #66620matthewseanmclachlanParticipantSo there’s no way to add java script to what I’m asking? So that when you click on “projects at the top of the screen it smoothly scrolls down to the projects section? Thank you for the clarification.
September 10, 2015 at 10:27 am #66621SakinKeymaster@matthewseanmclachlan: Not in my scope, you need to hire a customizer to add that script. For that you need to build child theme and add javascript.
October 17, 2015 at 11:57 pm #78019matthewseanmclachlanParticipantHey Sakin,
So I found this code as a possible solution for smooth scrolling, but wanted to run it by you before adding it. I think it wants me to paste in HTML. Let me know your thoughts.
Thanks!
Matt
Website:Here is the link I got it from: https://css-tricks.com/snippets/jquery/smooth-scrolling/
$(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); });
October 18, 2015 at 12:05 am #78023SakinKeymasterIn Catch Flames Pro theme, you can add the following script with
<script>
tag like following in “Appearance => Theme Options => Webmaster Tools => Header and Footer Codes => Code to display on Header” box:<script> $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); </script>
-
AuthorPosts
- The topic ‘Scroll Down To A Post’ is closed to new replies.