• Resolved Innervates

    (@innervates)


    Hello there!

    I’ve been using your plugin for awhile now, it works, but it’s also throwing a bunch of errors on our page.

    Primarily this

    “Uncaught TypeError. Cannot read property ‘top’ of undefined (repeated 150 times)” (the number increases every time the page is scrolled through.

    The error occurs here

    $(function() {
      var slidebox = $('#slidebox');
      if (slidebox) {
        $(window).scroll(function(){
            var distanceTop = $('#last').offset().top - $(window).height();

    Whatever that “top” is on the last line of the script, is not functioning properly – let me know how to fix it, thank you!

    https://wordpress.org/plugins/smooth-scroll-up/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Innervates

    (@innervates)

    did some searching around – and came up with this… as the solution for a similar problem using a sticky menu…

    var nav = $(‘.content-nav’);
    if (nav.length) {
    var contentNav = nav.offset().top;
    …continue to set up the menu
    }

    (this was the solution for someone else, so you might have to adjust the code to work for you, like whatever “contentNav” should be for your code)

    Thanks!

    Plugin Author Konstantinos Kouratoras

    (@kouratoras)

    I don’t have such a piece of code in my plugin. Maybe, the error is from some other plugin and not from Smooth scroll up?

    Plugin Author Konstantinos Kouratoras

    (@kouratoras)

    Dear Sir, have you checked if the error is occured by another plugin?

    Thread Starter Innervates

    (@innervates)

    Hi there, I did check into this – I thought it was your plugin due to a coincidence when I disabled the plugin.

    This has nothing to do with your’s, thank you!

    R.J.

    Plugin Author Konstantinos Kouratoras

    (@kouratoras)

    Glad to hear that. A review would be really appreciated.

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