Support Forums for LiveMesh Themes & Plugins › Forums › Appdev Theme Support › smooth scroll to single page sections
Tagged: drop-down, single page, smooth scroll, submenu
- This topic has 5 replies, 2 voices, and was last updated 11 years, 3 months ago by
Raghavendra.
-
AuthorPosts
-
December 27, 2013 at 6:36 am #3527
palmtree
ParticipantHi Code Master,
When I don’t activate “Single Page Site” (enabling auto generated menu) and instead by using WordPress default MENU I manually add section URL ids as “submenu (as drop-down)” say adding 2 different sections to one single page, the smooth scroll action isn’t working in between sections even though they are in the same single page. This doesn’t happen if the sections I manually added in the WordPress MENU aren’t “submenu (as drop-down)” but “parent menu”.
Please note that this situation occurs only in normal screen display.
When the screen is smaller like for mobile devices, regardless of location of section menu being “sub” or “parent”, smooth scroll works fine.Hope this makes sense.
I think as long as the section URL links are pressed in the menu when they are in the same single page (whether it’s located in submenu or parent menu), the smooth scroll should work.Is that possible for you to investigate this?
Thank you!
ToshiDecember 29, 2013 at 12:24 am #3554Raghavendra
ModeratorWill look into the issue. Thanks for bringing this to my notice. Should be easy to fix but my question to you is – is this really required for all? Internal links in the drop down menu is not common (dropdown menu itself is not common in single page sites) and then I guess we are just missing an effect and not the function itself; the link I assume still scrolls to the element. Will take a look.
December 30, 2013 at 10:03 am #3558palmtree
ParticipantThank you for looking into this!
I agree with you, Internal drop down by using dropdown menu is missing point… It may not be commonly used… however sometimes useful when people want to direct viewers to specific section in the same page. Rather than jumping to the section, it’s nice to have smooth scroll effect.Toshi
January 1, 2014 at 11:16 am #3581Raghavendra
ModeratorSorry this took some time due to holidays although the change was small. Here is the change you need to make. Pls edit the file js/main.js at line number 140 from
$('#primary-menu > ul > li > a[href*=#]').smoothScroll(
to
$('#primary-menu a[href*=#]').smoothScroll(
the smooth scroll should work fine for dropdown internal elements as well.
January 3, 2014 at 4:16 am #3597palmtree
ParticipantThanks a lot!
line 140 is now
$('.single-page-template #primary-menu a[href*=#]').smoothScroll(
not$('#primary-menu a[href*=#]').smoothScroll(
. There is “.sigle-page-template” up front is that ok?Also there are couple of lines that has the same codes as line 140 you told me to replace, but just the line 140 is fine?
Happy New Year:-)
ToshiJanuary 4, 2014 at 3:52 am #3608Raghavendra
ModeratorNo problems if you have .single-page-template and no need to change the other places. They exist for tracking purposes as you scroll down the page and for dropdowns you do not need to track and highlight menu items. Happy new year to you as well. Thanks 🙂
-
AuthorPosts
- The forum ‘Appdev Theme Support’ is closed to new topics and replies.