Anchor link in navigation prevents page from loading

Support Forums for LiveMesh Themes & Plugins Forums Agile Theme Support Anchor link in navigation prevents page from loading

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #4940
    Jrarelyjrarely
    Member

    Just trying to replicate the functionality of the sample data where you’ve got a single page with anchor links in the global navigation that correspond to sections down the page (www.mysite.com#services works in firefox, but not in chrome, http://www.mysite.com/#services doesn’t work in either, but at least the full page loads in chrome).

    In chrome, yours works, mine throws the following error:

    Uncaught Error: Syntax error, unrecognized expression: #services/ jquery.js?ver=1.10.2:3
    at.error jquery.js?ver=1.10.2:3
    mt jquery.js?ver=1.10.2:3
    kt jquery.js?ver=1.10.2:3
    at jquery.js?ver=1.10.2:3
    x.fn.extend.find jquery.js?ver=1.10.2:4
    x.fn.x.init jquery.js?ver=1.10.2:3
    e.fn.init jquery-migrate.min.js?ver=1.2.1:2
    x jquery.js?ver=1.10.2:3
    (anonymous function) main.js?ver=1.0:242
    x.extend.each jquery.js?ver=1.10.2:3
    x.fn.x.each jquery.js?ver=1.10.2:3
    MO_THEME.init_page_navigation main.js?ver=1.0:239
    MO_THEME.init_menus main.js?ver=1.0:322
    (anonymous function) main.js?ver=1.0:598
    c jquery.js?ver=1.10.2:3
    p.fireWith jquery.js?ver=1.10.2:3
    x.extend.ready jquery.js?ver=1.10.2:3
    q jquery.js?ver=1.10.2:3
    

    Tried adding $('a[href*=#]').smoothScroll(); to main.js with no luck.
    Can’t think of anything else that is causing the problem. Help would be appreciated.

    #4943
    Jrarelyjrarely
    Member

    Figured out my first problem. Site now loads, but still having trouble getting anchor links on other pages to work: like in the sample data, clicking the “Team” link from the blog page loads up directly at the “Team” page section on the homepage. In my case, it just scrolls to the top of the current page instead of going to the appropriate anchor. This is only true for the links in the global nav; other links within the page navigate as expected.

    #4947
    Jrarelyjrarely
    Member

    Upon further investigation, it doesn’t work with the installed sample data either, just on your site at https://www.livemeshthemes.com/agile/

    So…what file(s) did you forget to include in the theme? Why will the anchor links like https://www.livemeshthemes.com/agile/#services in the global nav work as expected when clicked from another page in the site on your server, but not on mine, even with the sample data and all plug-ins correctly installed and nothing else changed?

    Thanks!

    #4956
    Haochuanluhaochuanlu
    Member

    hi, my sebsite is http://en.sindrax.com/, and I have the same problem with you, which is I could not click the Anchor If I was not in the homepage.

    #4958
    RaghavendraRaghavendra
    Moderator

    A fix is coming in an update to be submitted in next few hours. More details will follow. Thanks

    #4960
    RaghavendraRaghavendra
    Moderator

    Pls modify the js/main.js file at line number 212 to look for the single page template in the condition.

    So, the line

                if ($().smoothScroll !== undefined) {
                    $('#primary-menu > ul > li > a[href*=#]').smoothScroll(
    

    changed to

                if ($().smoothScroll !== undefined) {
                    $(‘.single-page-template #primary-menu > ul > li > a[href*=#]').smoothScroll(
    

    so that smooth scroll does not get activated for pages which are not using single page site template. You can change the flag preventDefault in line number 214 to false instead of true but while solving the current problem, introduces a new “problem” where the div id suffixes get appended to the url in the address bar. Only problem with that – it changes the Back button flow.

    As said earlier, this fix will be part of upcoming update. The issue does not seem to affect the demo site.

    #4984
    Jrarelyjrarely
    Member

    Thanks! I actually found another work-around while I was waiting by creating another custom menu for the non-single page format pages; but I’ll check this out as well.

    #4994
    RaghavendraRaghavendra
    Moderator

    Great. Just want to mention, this is part of the latest update available for download.

    #5210
    Egoexmachinaegoexmachina
    Member

    Two things:

    1. I have the same problem. The anchors work great when I am in the main page. But once I am in a separate page, they don´t work at all. No response to the menu items with anchors if I click the menu in a different page. (curiosly enough, if I click the menu item, nothing happens. but if I right-button “open in a new tab”, it kind of works. doesn´t go to the right anchor, but at least it loads the correct page.
    Also, tried to fix the main.js as you suggested before. The menu works fine then, but the contents of the site don´t work at all. They just appear blank except for header and footer. In all pages of the site.
    I have my anchors in the menu written as “http://mysite.com/#pricing”. If I change them to “http://www.mysite.com/#pricing”, they work ok from different pages, but when I am in the main page, they reload the page and then go to the anchor. So no solution there.

    2. You mention an update available for download. Where is it? Where can I get it

    #5222
    Egoexmachinaegoexmachina
    Member
    This reply has been marked as private.
    #5256
    ErnestoErnesto
    Member

    Hi,

    Go to the Downloads Section of yout Theme Forest Account and there you can download the latest version of the Theme.

    #7056
    Kagamushukagamushu
    Member
    This reply has been marked as private.
    #7105
    NexusNexus
    Moderator

    I have replied to you in the dashboard. Pls check.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.