Roxyjee Posted April 2, 2020 Posted April 2, 2020 Site URL: https://www.susanchalkermassage.com/ Hi Guys, I have added code in my header to link my folders in my navigation to an anchor on my homepage as I have created a one pager. Only the blog ,contact form and from Lomi Lomi in the dropdown of massages all goes to its own page. The issue I am having is ....It works at first as you will see when you go to the site https://www.susanchalkermassage.com/ but as soon as I Click the Logo to go to homepage and try and click on the Header links (Say I go to the About page, it says "This folder does not contain any pages."). Its also not linking on mobile at all. Did I add something wrong in my code or am I missing something. <script type="text/javascript" src="jquery-1.11.1.min.js"></script> <!-- Redirecting Testimonial on nav --> <script> Y.on('domready', function(){ Y.one('nav a[href="/testimonial"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#testimonial-home'; }); }); </script> <!-- Redirecting About on nav --> <script> Y.on('domready', function(){ Y.one('nav a[href="/about"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#susan'; }); }); </script> <!-- Redirecting Individualized Massage on nav --> <script> Y.on('domready', function(){ Y.one('nav a[href="/individualized"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#individualized-massage'; }); }); </script> <!-- Redirecting Location on nav --> <script> Y.on('domready', function(){ Y.one('nav a[href="/location"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#location-address'; }); }); </script> <!-- Redirecting Massages on nav--> <script> Y.on('domready', function(){ Y.one('nav a[href="/rates"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#massage-rates'; }); }); </script> <!-- Redirecting massages page --> <script> Y.on('domready', function(){ Y.one('nav a[href="/massages"]').on('click', function(e){ e.preventDefault(); e.stopPropagation(); window.location = 'https://www.susanchalkermassage.com/#massage-modalities'; }); }); </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> function anchorLinks(){ Y.all("a.Mobile-overlay-nav-item").on('click', function() { Y.one('body').removeClass('is-mobile-overlay-active'); }); Y.all("a.Mobile-overlay-folder-item").on('click', function() { Y.one('body').removeClass('is-mobile-overlay-active'); }); if(!Y.one('.collection-type-index')){ Y.all(".Mobile-overlay-nav--primary .Mobile-overlay-nav-item:not(.Mobile-overlay-nav-item--folder')").each(function(){ this.on("click", function(){ var newURL = "http://"+window.location.host +(this.getAttribute('href')); window.location.href = newURL; }); }); } } function scrollToURLAnchor(){ setTimeout(function(){ if(window.location.hash){ $('html, body').animate({ scrollTop: $(window.location.hash).offset().top }, 600, function () { }); } }, 700); } Y.on('domready', function(){ anchorLinks(); scrollToURLAnchor(); if(window.location.hash != ''){ $('a[href*="#"].Mobile-overlay-nav-item').on('click', function(){ var newURL = 'http://'+window.location.host +$(this).attr('href'); window.location = newURL; }); } }); window.addEventListener('mercury:load', anchorLinks); window.addEventListener('mercury:load', scrollToURLAnchor); </script>
tuanphan Posted April 2, 2020 Posted April 2, 2020 Disable Ajax Loading: https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Roxyjee Posted April 3, 2020 Author Posted April 3, 2020 On 4/2/2020 at 11:59 AM, tuanphan said: Disable Ajax Loading: https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading Oh my WORD! Thanks so much @tuanphan I completely forgot to disable ajax, its working now. Just a question why wouldn't my mobile menu work though? It's now not linking to where it should it's showing as a folder and then clicking in the folder. Do I have to add css?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.