There is a link to open the file and a picture, but they do not work if you click on them, but if you click open in a new tab, the required file opens. Here is the html code:

<div class="col-12 col-sm-4"> <div class="home-hover navigation-slide"> <a href="/files/111.pdf"> <img src="images/PDF.png" style="width:20%"> </a> </div> <a href="/files/111.pdf"> <span style="color:white;">DOWNLOAD PDF</span> </a> </div> 

Here are the errors in the console that appear when you click on the image:

 script.js:187 Uncaught TypeError: Cannot read property 'top' of undefined at goToByScroll (script.js:187) at HTMLDivElement.<anonymous> (script.js:206) at HTMLDivElement.dispatch (jquery-1.10.2.min.js:5) at HTMLDivElement.v.handle (jquery-1.10.2.min.js:5) 

Here is the code from the scripts, script.js:

 jQuery(document).ready(function ($) { //Cache some variables var links = $('.nav').find('li'); slide = $('.slide'); button = $('.button'); mywindow = $(window); htmlbody = $('html,body'); //Create a function that will be passed a slide number and then will scroll to that slide using jquerys animate. The Jquery //easing plugin is also used, so we passed in the easing method of 'easeInOutQuint' which is available throught the plugin. function goToByScroll(dataslide) { var offset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide="' + dataslide + '"]').offset().top; htmlbody.stop(false, false).animate({ scrollTop: offset_top }, 1500, 'easeInOutQuart'); } //When the user clicks on the navigation links, get the data-slide attribute value of the link and pass that variable to the goToByScroll function links.click(function (e) { e.preventDefault(); dataslide = $(this).attr('data-slide'); goToByScroll(dataslide); $(".nav-collapse").collapse('hide'); }); //When the user clicks on the navigation links, get the data-slide attribute value of the link and pass that variable to the goToByScroll function $('.navigation-slide').click(function (e) { e.preventDefault(); dataslide = $(this).attr('data-slide'); goToByScroll(dataslide); $(".nav-collapse").collapse('hide'); }); }); 

Error on strings:

  var offset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide="' + dataslide + '"]').offset().top; и goToByScroll(dataslide); 

And errors in another file in the lines:

  while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped())(!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((x.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation())) и return typeof x === i || e && x.event.triggered === e.type ? t : x.event.dispatch.apply(f.elem, arguments) 
  • Nobody knows? - Midnight
  • Processing a click on the image, but not in the text. When you click on the picture, you get an error, since there are no .top properties. If you click open in a new tab, processing does not start, but simply opens the link. The question is why there is no .top property? - Max
  • @ Maxim I need to add the variable top? - Midnight
  • Not. Your $('.slide[data-slide="' + dataslide + '"]') selector does not find anything. Hence offset() will return undefined . - Max

0