Title: TypeError in prevous developers code.
Last modified: September 1, 2016

---

# TypeError in prevous developers code.

 *  [Martijn](https://wordpress.org/support/users/ximie90/)
 * (@ximie90)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/typeerror-in-prevous-developers-code/)
 * 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)

 *  [Ravikumar Patel](https://wordpress.org/support/users/ravipatel/)
 * (@ravipatel)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/typeerror-in-prevous-developers-code/#post-7474770)
 * Please check have u getting “target” value?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 11 months ago](https://wordpress.org/support/topic/typeerror-in-prevous-developers-code/#post-7474797)
 * > 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/typeerror-in-prevous-developers-code/#post-7474797)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
