-1

The following script is working live for 2 times. The third time i click on a a with a hash it does not work any more and the following error shows up in the Console. Any ideas?

TypeError: 'undefined' is not a function (evaluating 'n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration)')

Screenshot: enter image description here

My Code:

$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
  var target = $(this.hash);
  target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  if (target.length) {
    $('html,body').animate({
      scrollTo: target.offset().top
    }, 500);
    return false;
  }
}  });

$(window).scroll(function() {
if ($(this).scrollTop() > 220) {
    $('.backtotop').fadeIn(200);
} else {
    $('.backtotop').fadeOut(200);
}});

Code from the html:

<a href="#link">LINK</a>
<div id="link">TARGET</div>

Thanks a lot!

Max
  • 608
  • 1
  • 7
  • 23

1 Answers1

0

There has been a different error in the code. I am very sorry :) I have a slider, which does not work. Superslides BTW. After 4 seconds the error above appears.

Max
  • 608
  • 1
  • 7
  • 23