• Resolved Urmil Patel

    (@urmilwp)


    I have use one page scroll but not working in live.

    custom.js:73 Uncaught TypeError: Cannot read property 'top' of undefined
        at HTMLAnchorElement.<anonymous> (custom.js:73)
        at Function.each (jquery.min.js:2)
        at k.fn.init.each (jquery.min.js:2)
        at custom.js:71
        at dispatch (jquery.min.js:2)
        at v.handle (jquery.min.js:2)
    var scrollLink = $('.page-scroll');
        // Active link switching
        $(window).scroll(function () {
            var scrollbarLocation = $(this).scrollTop();
    
            scrollLink.each(function () {
    
                var sectionOffset = $(this.hash).offset().top - 150;
                 //console.log(sectionOffset);
                if (sectionOffset <= scrollbarLocation) {
                    $(this).parent().addClass('active');
                    $(this).parent().siblings().removeClass('active');
                }
            });
        });
    });
    • This topic was modified 4 years, 4 months ago by Urmil Patel.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught TypeError: Cannot read property ‘top’ of undefined’ is closed to new replies.