scroll down disappears - Forum | JoomShaper
Solved Helix Framework

scroll down disappears

Asked by Laurent 10 months ago Last activity 9 months ago

Hi,

I have a strange behavior on a website.
on menu, when I click here for instance https://prnt.sc/PCFZSXkhxLdR the page scrolls correctly, but vertical scroll on web browser (chrome) disappears.

Any idea why?

live url in Hidden Content area

Thanks
L.

Accepted answer

Marked as the solution
Laurent Asked this

problem solved.
corrected code below

jQuery(function($) {

    function forceCloseOffcanvas() {

        $('.offcanvas-init').removeClass('offcanvas-active full-offcanvas');
        $('body').css('overflow', '');

        $('.offcanvas-menu')
            .attr('inert', '')
            .attr('tabindex', '-1');

        $(document).off('keydown.offcanvas');
    }

    $('.close-offcanvas, .offcanvas-overlay, .offcanvas-inner ul > li:not(.no-scroll) > a')
        .on('click', function() {
            forceCloseOffcanvas();
        });

    $(document).on('click', '.offcanvas-menu a', function () {

        var href = $(this).attr('href');

        if ($(this).hasClass('close-offcanvas') || $(this).hasClass('no-close-offcanvas')) {
            return;
        }

        if (href && href.indexOf('#') === 0 && href.length > 1) {
            setTimeout(forceCloseOffcanvas, 150);
        }
        else if (href && href.indexOf('#') > -1 && !href.match(/^https?:\/\//)) {

            var hashIndex = href.indexOf('#');
            var currentPath = window.location.pathname;
            var linkPath = href.substring(0, hashIndex) || currentPath;

            if (linkPath === currentPath || linkPath === '' || linkPath === '/') {
                setTimeout(forceCloseOffcanvas, 150);
            }
        }
    });

    $(window).on('hashchange', function() {
        if ($('.offcanvas-init').hasClass('offcanvas-active')) {
            forceCloseOffcanvas();
        }
    });

});

5 more replies

Rashida Rahman Staff

Hello There,

I hope you’re doing well. I’m sorry for the experience you’ve had so far.

To look into this issue more closely, could you please share temporary Super Admin access (inside the hidden content box)? I’ll check this and update you as soon as possible.

Please make sure to keep a full site backup before sharing the credentials, just to be safe.

Best regards,

Laurent Asked this

ok done
see Hidden Content area

Rashida Rahman Staff

Hi,

Please take my apology. I'm trying some custom JS code, but facing some difficulty to add them in your system. Please allow me time.

Laurent Asked this

no problem, thank you

Rashida Rahman Staff

Hi Laurent,

You are welcome.

Are you using any server side caching, please? I have made some changes, but it is not reflecting. Kindly do let me know.

Thanks!

Laurent Asked this

there is a cache plugin installed on joomla.

Rashida Rahman Staff

Thanks! Kindly, clear your cache, check and let me know.

Laurent Asked this

ok works fine now.
what have you done?
where was the issue exactly?

Rashida Rahman Staff

Thanks for letting me know about the update. I have created and added some code in the custom.js file inside your template.

Laurent Asked this

ok but why this problem occured?
everything was fine since few months/years.
will you merge this fix with next helix update?

Rashida Rahman Staff

Not everyone is facing this issue, so I'm unsure about the reason behind this. Really sorry about that.

Laurent Asked this
9 months ago · edited

ok thanks.
about custom.js you have added, this file is loaded automatically by helix or you have added some code somewhere to load it?

Laurent Asked this

ok thanks

Laurent Asked this
9 months ago · edited

hi,

I have applied the fix you did on my website to another website, but I still have the issue.

I have created this js file /templates/shaper_helixultimate/js/custom.js
and inside I have added this code :

jQuery(function($) {
    $('.close-offcanvas, .offcanvas-overlay, .offcanvas-inner ul > li:not(.no-scroll) > a')
        .on('click', function() {
            $('body').removeClass('offcanvas-active');
        });

    $(document).on('click', '.offcanvas-menu a', function (event) {
        var href = $(this).attr('href');
        if ($(this).hasClass('close-offcanvas') || $(this).hasClass('no-close-offcanvas')) {
            return;
        }
        if (href && href.indexOf('#') === 0 && href.length > 1) { 
            setTimeout(function() {
                closeOffcanvas();
            }, 150);
        }
        else if (href && href.indexOf('#') > -1 && !href.match(/^https?:\/\//)) {
            var hashIndex = href.indexOf('#');
            var currentPath = window.location.pathname;
            var linkPath = href.substring(0, hashIndex) || currentPath;

            if (linkPath === currentPath || linkPath === '' || linkPath === '/') {
                setTimeout(function() {
                    closeOffcanvas();
                }, 150);
            }
        }
    });

    $(window).on('hashchange', function() {
        if ($('.offcanvas-init').hasClass('offcanvas-active')) {
            closeOffcanvas();
        }
    });

});

but same problem : vertical scroll on web browser (chrome) disappears when an item menu is clicked.
see Hidden Content area for website link.

any idea why?

Thanks
L

Rashida Rahman Staff

Hi,

Are you facing this issue on mobile devices with offcanvas menu?

Kindly share your admin access to check.

Laurent Asked this

both : PC + mobile.
see Hidden Content area for credentials

Rashida Rahman Staff

Hi,

Thanks for the credentials.

On desktop/laptop, it looks fine on my end. Please make sure all caches are cleared, including both Joomla and any server-side caching, if you are using them.

Laurent Asked this

Already done, same problem.
I'm sorry but does not work.
Do this

Rashida Rahman Staff

Thanks for the update and glad that you have succeeded to resolve that.

Best regards,

Log in to reply.