mardi 1 mai 2018

Can't solve JavaScript error, crumby code

I was tasked with updating a website for client, he told me that he needed to have the site redesigned for someone.

I keep getting an error on line 29 'Uncaught TypeError: Cannot read property 'top' of undefined'

I've done about over an hour of troubleshooting and can't seem to solve it, please send help. btw the code was minified and I unminified it.

$("#math-captcha").mathCaptcha({
  imgPath: "src/img/",
  operation: "plus",
  introText: "Please enter the result of equation:",
  successFunction: function() {
    form = $("form"), $("#but").append('<button type="submit" style="margin-top: 20px;" class="btn btn-primary btn-md">Send Message</button>'), $(".math-captcha-error").remove()
  },
  failFunction: function() {
    form = $("form"), $("#butt").remove(), $(".math-captcha-error").length < 1 && $("#math-captcha").append("<p class='math-captcha-error'>Wrong result!</p>")
  }
}), $("#p-arrow").click(function() {
  $("html, body").animate({
    scrollTop: $("#about2").offset().top
  }, 1e3)
}), $("#header-arrow").click(function() {
  $("html, body").animate({
    scrollTop: $("#about").offset().top
  }, 1e3)
}), (new WOW).init(),
function(t) {
  "use strict";
  t(document).ready(function() {
    t(window).scroll(function() {
      t(window).scrollTop() >= 100 ? t("img.affix-top").css("display", "none") : t("img.affix-top").css("display", "block")
    })
  }), t("a.page-scroll").bind("click", function(a) {
    var o = t(this);
    t("html, body").stop().animate({
      scrollTop: t(o.attr("href")).offset().top - 50
    }, 1250, "easeInOutExpo"), a.preventDefault()
  }), t("body").scrollspy({
    target: ".navbar-fixed-top",
    offset: 51
  }), t(".navbar-collapse ul li a:not(.dropdown-toggle)").click(function() {
    t(".navbar-toggle:visible").click()
  }), t("#mainNav").affix({
    offset: {
      top: 100
    }
  }), window.sr = ScrollReveal(), sr.reveal(".sr-icons", {
    duration: 600,
    scale: .3,
    distance: "0px"
  }, 200), sr.reveal(".sr-button", {
    duration: 1e3,
    delay: 200
  }), sr.reveal(".sr-contact", {
    duration: 600,
    scale: .3,
    distance: "0px"
  }, 300), t(".popup-gallery").magnificPopup({
    delegate: "a",
    type: "image",
    tLoading: "Loading image #%curr%...",
    mainClass: "mfp-img-mobile",
    gallery: {
      enabled: !0,
      navigateByImgClick: !0,
      preload: [0, 1]
    },
    image: {
      tError: '<a href="%url%">The image #%curr%</a> could not be loaded.'
    }
  })
}(jQuery);




Aucun commentaire:

Enregistrer un commentaire