Before you ask please READ THIS

Navigation Anchors from another page

edited May 2015 in Chillout Posts: 54
Hi Apollo,

Would it be possible to get some advice on Navigation anchors?
I am having trouble getting the anchor links to work when navigating from any page other than the home page.

I have set up our one page website, the navigation anchors work on the home page, scrolling down to the correct section as they should - sometimes it doesn't stop exactly at the top of the selected row, but it stops in the right section.

If I navigate away from the home page - for example click on one of the logos in "The Group" section on our home page which links to another page. When I click on the group in the nav menu - it takes me to the top of the home page and not back to "the group" section on the home page, so the user needs to scroll down back down to the group section on our home page. This issue is for navigating back to all of the anchor links on the home page from the other pages.

How would I link these individual pages back to the anchor link on our home page?

kind regards,
Mandy

http://pmngroup.com/wordpress/

Comments

  • edited May 2015 Posts: 1,758
    Hello,
    It's not the bug.
    I can see that You've made some hard_coded changes, and they caused JavaScript conflicts, and therefore the website is not working as it should be.
    Post edited by surgeon on
    Remember to rate our theme if you like it ;)
    All the Best.
  • Posts: 1,758
    You've removed Logo and Preloader HTML elements and You get these errors:
    TypeError: $preloader.velocity is not a function
    http://pmngroup.com/wordpress/wp-content/plugins/chillout-plugin/script.js?ver=1.0.8
    Line 181
    TypeError: $logo.velocity is not a function
    http://pmngroup.com/wordpress/wp-content/themes/chillout/js/scripts.js?ver=1.3.4
    Line 178
    make some changes to JS files as well OR get those HTML elements back (You can make them invisible though).
    Remember to rate our theme if you like it ;)
    All the Best.
  • Posts: 54
    Thank you, I will look into the above mentioned suggestions.
  • Posts: 54
    Hi, Im not sure if Ive done what you've asked correctly?
    I've taken over the job from a colleague as he is on holiday so I am unsure where the HTML elements were removed from. I can see that they are disabled in the chillout options on the dashboard.

    So instead Ive hidden " // " the error causing code mentioned above in the .js files and loaded them to my child theme.

    Is this correct?
  • Posts: 1,758
    Logo element should be inside the menu_bar.php file
    Preloader element should be inside the header.php file
    Remember to rate our theme if you like it ;)
    All the Best.
  • Posts: 54
    Thank you for your advice.
    Hiding the $logo.velocity and $preloader.velocity in the script.js files has got the navigation anchors working when navigating from another page.

    I don't think I placed the script.js files in my child theme correctly, as they were still bringing up an error in the console --- so i have had to replace them in the core files. which is not ideal for future updates.

    *Are you able to advise how I can correctly file the two script.js files in the child theme, so that future updates will not cause issues?

    p.s
    I couldn't find any html code missing from menu_bar.php or header.php file.
    I compared the codes against the latest chillout version we are using (1.3.4), and the files were the same - only menu_bar.php has custom code added to it (which is the additional header space above the nav bar)

    The only place I can see where these items have been removed are in the chillout options on the dash board - they have been disabled.

    many thanks for your continued support on this theme.

  • Posts: 1,758
    Mandy said: Are you able to advise how I can correctly file the two script.js files in the child theme, so that future updates will not cause issues?
    https://wordpress.org/support/topic/how-to-add-js-files-to-child-theme
    https://codex.wordpress.org/Child_Themes
    Remember to rate our theme if you like it ;)
    All the Best.
  • Posts: 54
    Thank you.
  • Posts: 54
    Because we have customised our site to have 145px header space above the nav menu bar. When an item on the nav menu is clicked, the nav anchor scroll doesn't always stop at the top of that row/item underneath the nav bar. Instead it scrolls past the title of the row and it stops in the middle of the row cutting off the content in that block.

    Are you able to advise where/how I can adjust these settings?

    Ive tried to look into it myself and not had much luck with adjusting this setting.
    I can see that the script for the scroll is in the Chillout JS folder script.js file. But I'm struggling to understand/find where to adjust the height/stopping point of the nav anchor scroll.

    any advice would be gratefully received.

    Thanks You.
    www.pmngroup.com/wordpress
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion