• Hi,

    I’m currently helping to rebuild a theme/website after a hack.
    The original developer is nowere to be found & my knowledge of JQuery is limited.

    I there is a back to top button, this one works. Next to it there is a button with the text ‘disable automatic scrolling’.

    When you press that button only the text changes to ‘enable automatic scrolling’ and in my firebug I see a ” TypeError : jQuery(…).offset(…) is undefined “

    which origins from:

    var jump=function(e)
    {
        //alert('here');
       if (e){
           //e.preventDefault();
           var target = jQuery(this).attr("href").replace('/', '');
       }else{
           var target = location.hash;
       }
    
       jQuery('html,body').stop(true, true).delay(1000).animate(
       {
           scrollTop: (jQuery(target).offset().top) - 0
       },1100,function()
       {
           //location.hash = target;
       });
    
    }

    First of all what is this script trying to do, and how do I make it work again?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Please check have u getting “target” value?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The original developer is nowere to be found & my knowledge of JQuery is limited.

    The best thing you can do is link to the page where this code is running so that a volunteer can help you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘TypeError in prevous developers code.’ is closed to new replies.