Streaming live at 10am (PST)

Pop-up : Custom code blocking interactions


#1

Hi there,

If anyone can help, that’d be great.

Using a cookie (custom code), I have a pop-up that only appears on the users initial visit. (Home page only)
Note: I took out all interactions on this page until I figure this out

Website : http://hellogrow.com/

Read only link : https://preview.webflow.com/preview/grow-d13c05?preview=0ce527a4df83a0dbcbf34aaba614e3be

If you wanna see an example of the interactions not working, here’s a link :
http://hellogrow.com/backup

The code :

$(document).ready(function()
{
    $(window).scroll(function() 
    {
        if ($(window).scrollTop()  > $(document).height() / 6) {
            var alert = getCookie('alert');

            if (alert != 1) {
                $('.popup-overlay').fadeIn(300);
                document.cookie = "alert=1; expires=Wed, 31 Dec 2025 12:00:00 UTC";
            }

            $(this).unbind('scroll');
        }
    });
});

function getCookie(cname) 
{
    var name          = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca            = decodedCookie.split(';');
    
    for (var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }

        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }

    return "";
}

The pop-up

So if you know what’s causing this or what could I do to fix it, I’d really appreciate it.

Cheers