Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1303037

    Hi
    I don’t know if this is the right term in English, but I would like to deactivate the “page down / page up” effect when you click on an anchor on a page.
    On a short page this is fine – but on a long page with alternating white / black color sections it is horrible to the eyes.

    Deactivation for all the site. I click on an anchor > I arrive on the id/anchor with no effect. Or a very speed effect perhaps / and-or with a fade in.

    Thank you.
    Best regards
    Seb

    #1303345

    Hey Astaryne,

    Thank you for the inquiry.

    You might be referring to the smooth_scroll function. To deactivate it, please edit the js > avia.js file and remove the code which is located around line 95.

    //smooth scrooling
    		if( $.fn.avia_smoothscroll )
    		{
    			$('a[href*="#"]', container).avia_smoothscroll(container);
    		}
    

    Please toggle or temporarily disable the Enfold > Performance > File Compression settings.

    Best regards,
    Ismael

    #1414000

    For the function:

    //smooth scrolling
    		if( $.fn.avia_smoothscroll )
    		{
    			$('a[href*="#"]', container).avia_smoothscroll(container);
    		}

    Can this function be modified to add a smooth scroll to an anchor link that is on another page? For example if there is a / that occurs before the hash because the anchor is on another page:

    
    if( $.fn.avia_smoothscroll )
    	{
    		$('a[href*="#"]', container).avia_smoothscroll(container);
    		$('a[href*="/#"]', container).avia_smoothscroll(container);
    	}
    

    If so, should I do this rewrite in the child theme? (I understand that I need to keep the same file structure in the child theme as the parent theme)

    I am not proficient with javascript, so please excuse any laughable errors on my part.

    Thanks in advance!

    • This reply was modified 1 year, 5 months ago by rlhinirv57.
    #1414175

    Hi,
    Thanks for your question, the current a[href*=”#”] is correct for links to another page, the reason that it doesn’t work as expected is that browser match the hash on page load, the way around this is to remove the hash from the url and load the page at the top with window.scrollTo(0, 0); and then add the hash to smooth scroll to it.
    Instead of reinventing the wheel try the plugin Page scroll to id and in the settings try Scroll duration of 1500 and an Offset of 125 and leave all of the other default settings.
    You may notice the page reset as I explain earlier so if you want to avoid this your the Enfold Theme Options ▸ Page Preloading it will hide the page reset and then you will see the smooth scroll to the ID when coming from another page, and when going to an ID on the same page the Page Preloading will not show and the page will smooth scroll to the ID.

    Best regards,
    Mike

    #1414281

    Hello Mike,

    Thank you! I was previously unaware of that plugin – I did install it and everything works as wanted. It’s exactly the solution I needed!

    Kind regards,
    Rhonda

    #1414286

    Hi Rhonda,

    I’m glad that Mike could help you :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Disable effect > Go to anchor’ is closed to new replies.