Tagged: smooth scrolling
-
AuthorPosts
-
October 4, 2014 at 5:59 pm #330248
Hey gang,
Just installed the new v3.0. Looking forward to dig into it.
Is there a way, in v3.0, to add an offset value to the smooth scrolling text anchors?
I’ve added at the bottom of each of my color section, on a one pager. But once the link is clicked, it does go to the right section, but the bottom doesn’t align properly.
Let me know! Tks.
October 6, 2014 at 7:00 am #330719Looking for an answer to this as well.
Thank you Kriesi team!
-MacOctober 7, 2014 at 11:23 am #331494Hi!
Try adding this code to the Quick CSS or custom.css:
.avia-section .scroll-down-link{
bottom:60px !important;
}
Should this not help, please provide a mockup screenshot of the result you wish to achieve.
Regards,
ArvishOctober 8, 2014 at 6:04 am #332130Hey Arvish,
Thanks for the help. Visually, it does solve the issue. But in reality, it doesn’t. You’ll see that I still have other content that is at the bottom of each of the color sections. I would need to hack that for each of my sections.
I think the issue is that the color sections are set to have 100% height of the browser window. If there was a way I could tell the system that, the 100% needs to take in account the sticky header height, that would probably work. Right now that top of the color sections is stoping at the bottom of the sticky headers. Thus making the next anchor not visible to the reader, until you scroll down a bit.
But I think the easiest way to go about this, would be to be able to set any offset to the smooth scrolling.
Probably all of this is not an easy fix…
Thanks anyways,
PhetOctober 9, 2014 at 6:24 am #332955Hi!
Could you please forward us a screenshot mockup of the issue and the end result you wish to achieve to help us better understand and troubleshoot the issue.
Best regards,
ArvishApril 24, 2015 at 11:31 am #434032Hey Phet,
it seems you just can do that, if you modify the file “avia.js”. You need to redo it after every Enfold-update.
Go to: – /enfold/js/avia.js – and open it.
Search the function ( ” $.fn.avia_smoothscroll = function(apply_to_container) ” ). It starts round about at line 700.
There you need to find this condition –> if(container.length)
change the following code:
if(container.length) { var cur_offset = the_win.scrollTop(), container_offset = container.offset().top, target = container_offset - fixedMainPadding, hash = window.location.hash, hash = hash.replace(/\//g, ""), oldLocation=window.location.href.replace(hash, ''), newLocation=this, duration= data.duration || 1200, easing= data.easing || 'easeInOutQuint';
against this:
if(container.length) { var usersviewportWidth = $(window).width(); if(usersviewportWidth > 767 ){ var myOffset = 75; } else { var myOffset = 0; } var cur_offset = the_win.scrollTop(), container_offset = container.offset().top, target = container_offset - fixedMainPadding + myOffset, hash = window.location.hash, hash = hash.replace(/\//g, ""), oldLocation=window.location.href.replace(hash, ''), newLocation=this, duration= data.duration || 1200, easing= data.easing || 'easeInOutQuint';
Please note the line: “var myOffset = 75;”
This value depends on your settings and perhaps you need to adjust it. If you change the breakpoint for mobile-menu, you have also to change this (767) –> if(usersviewportWidth > 767 ) — to the value your breakpoint is set.
Perhaps in a future update it is possible to adjust this from the options-panel.
Good luck, best regards
April 24, 2015 at 1:56 pm #434066Hey!
Thank you for sharing Bruno! If you would like to request it to be added in future versions, please feel free to request it here – https://kriesi.at/support/enfold-feature-requests/ :)
Cheers!
YigitApril 24, 2015 at 2:11 pm #434083Thanks for the tip Bruno!
-
AuthorPosts
- The topic ‘Adding offset value to smooth scrolling anchor links’ is closed to new replies.