Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1103946

    Hi guys

    I am struggling with the following:
    There is an accordion element on the website which works nice and easy (if I use the accordion toggles itself to open/close them).

    In addition to that, there is the site navigation in the right column (see example below).
    So if I use that navigation on the right to open the same toggle in the middle with the same link, the browser always scrolls to that position. This is not the case if I open/close the accordion directly in the middle, but with the same links.

    How do I get rid of the random scroll behaviour?

    Thanks in advance

    Just tried the following jQuery inside functions.php – probably the wrong code:

    $(document).on('click', 'a[href^="#"]', function (event) {
    	$('html, body').animate({
            scrollTop: $($.attr(this, 'href')).offset().top
        }, 1400);

    Hey Michael,

    Thank you for using Enfold.

    That is the scrollspy script for the main menu items. It’s in the js > avia.js file.

     //scrollspy for main menu. must be located before smoothscrolling
    			if(container == 'body')
    				$('body').avia_scrollspy({target:'.main_menu .menu li > a'});

    You can disable that script but it will also affect the smooth scroll option.

    Best regards,


    Hey Ismael

    Thank you very much for your reply – I appreciate it.

    I commented that part of the file avia.js out, but unfortunately this does not do anything.
    I located the file inside my child theme in js -> avia.js but as I said, it is still scrolling like before.

    What am I missing? Pretty sure it is not caching.

    Best regards


    Ah – it was caching, sorry.

    So I guess disabling that is not an option either, because then the viewport obviously just stays where it is and always scrolling to the top instead is not possible, right?
    In this case the whole content in the middle would become visible again.



    I think it will still work, but the smooth scrolling animation or effect for the anchors will be removed.

    Best regards,


    Thanks Ismael – you can close this thread please.



    Thanks for the update, I’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Accordion same link but different behaviour’ is closed to new replies.