Tagged: x
-
AuthorPosts
-
June 17, 2016 at 4:00 pm #1047536
amirwin1ParticipantHello! Thank you for awesome theme, it’s always a pleasure to work with it.
I’m using one-page navigation and I used this code to make proper navigation from other pages:
https://community.theme.co/forums/topic/page-links-using-ids/page/3/#post-165513
This works great, except all items are now highlighted and have the class “.current-menu-item”.
Here is my site: http://f59.464.myftpupload.com/
WP version: 4.5.2
X version: 4.5.2
Cornerstone: 1.2.4How can I fix it?
Thanks!
June 17, 2016 at 9:11 pm #1047893
FriechModeratorHi There,
Thanks for writing in! Is this your page? https://www.abbyirwinmd.com/ URL you provided above redirects me on that site and I don’t see one page navigation setup in there. Please clarify.
In the meantime, make sure your one page navigation menu is not set as the primary menu.
Cheers!
June 18, 2016 at 2:21 am #1048187
amirwin1ParticipantHi, Friech!
I disabled the Coming-soon redirecting plugin, now you should’ve access to the website, sorry for that! http://f59.464.myftpupload.com/I think it has fixed itself somehow. But I still have one issue.
Steps to reproduce:
1) Go to http://f59.464.myftpupload.com/
2) Navigate to blog
3) Navigate to “Pricing” (or any other except “Home”)
4) The menu item is not highlighted, as it should.Is it possible to make the appropriate menu highlighted when navigating from another page?
Thank you!
June 18, 2016 at 2:44 am #1048217
Rue NelModeratorHello There,
Thank you for the clarifications. I can confirm and replicate the issue you are having. Could you please let us know that you have create two separate menus? One should be exclusively used for one page navigation and the other as your primary menu.
To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
June 18, 2016 at 4:34 am #1048283
amirwin1ParticipantThis reply has been marked as private.June 18, 2016 at 7:41 pm #1048747
Rue NelModeratorHello There,
Thanks for the very detailed information! I have checked your site and it turns out that you have set up the one page navigation incorrectly. And also this js code is causing an issue,
// Conditions // 1. Menu should be using full url, eg. http://site.com/#x-content-band-1 and not just #x-content-band-1 // 2. Use just one menu for both Primary and One Page. jQuery(function($){ var window_base = window.location.href.split("#").slice(0)[0]; var window_hash = window.location.hash == '' ? 'body' : '#'+window.location.href.split("#").slice(-1)[0]; var outbound = /^https?:///i; $('.x-nav a').each(function(){ //Scan links and convert them to relative hash for one page navigation's Active statuses to work properly when manually scrolling var hash = /#/.test( $(this).attr('href') ) ? '#' + $(this).attr('href').split("#").slice(-1)[0] : ''; var anchor_base = /#/.test( $(this).attr('href') ) ? $(this).attr('href').split("#").slice(0)[0] : $(this).attr('href'); if(hash) { //Does it have hash? then perform check if(anchor_base == window_base) { //If same page, then no need to reload, just make it relative $(this).attr('href', hash); } // Else, leave it that way. So when user clicked, it will just link them to outbound page } }).click(function(e){ //Enable Parent and Submenu scrolling var hash = /#/.test( $(this).attr('href') ) ? '#' + $(this).attr('href').split("#").slice(-1)[0] : 'body'; if(hash && !outbound.test( $(this).attr('href') ) ) { //Does it have relative hash? e.preventDefault(); //Disable jumping e.stopPropagation(); $('html,body').animate({ scrollTop: $( hash ).offset().top - $('.x-navbar').height()}, 700); //Now add active status for automatic scrolling $('.x-nav li').removeClass('current-menu-item'); $(this).parent().addClass('current-menu-item'); } }); $('html,body').css({ scrollTop : 0}); setTimeout( function(){ $(document).ready(function(){ // Enable auto scroll when loaded. $('.x-nav li').removeClass('current-menu-item'); //$('a:not([href*="#"])').parent().addClass('current-menu-item'); For experiment only if(window_hash) { $('a[href$="'+window_hash+'"]').click(); //Click it, so it will use default click from one page navigation event and submenu event } }); }, 300); });I temporarily removed the JS code and changed the menu settings. Right now, the indicator is now properly displaying in the correct section when it is displaying.
June 19, 2016 at 7:31 am #1049177
amirwin1ParticipantHi, Rue Nel!
Everything works great, thank you very much for your help!June 19, 2016 at 11:17 am #1049353
RupokMemberYou are welcome!
Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.
Thanks for using X.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1047536 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
