Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #330719

    Looking for an answer to this as well.
    Thank you Kriesi team!
    -Mac

    #331494

    Hi!

    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,
    Arvish

    #332130

    Hey 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,
    Phet

    #332955

    Hi!

    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,
    Arvish

    #434032

    Hey 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

    #434066

    Hey!

    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!
    Yigit

    #434083

    Thanks for the tip Bruno!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Adding offset value to smooth scrolling anchor links’ is closed to new replies.