0
$('.jumbotron').click(function(event){
    $("html, body").animate({ scrollTop: window.pageYOffset + $(window).height() }, 500);
});

How can I change the + mark to a minus? It immediately breaks if I change the order... So jumbotron is 100vh just need to scroll 100vh or the remaining if scrolled.

niksos
  • 403
  • 1
  • 6
  • 19
  • Find the offset of the element `.jumbotron` and scroll to this position instead – empiric Feb 15 '17 at 19:57
  • Possible duplicate of [jQuery scroll to element](http://stackoverflow.com/questions/6677035/jquery-scroll-to-element) – empiric Feb 15 '17 at 19:58

1 Answers1

1

Am I correct in interpreting that you want to vertically scroll have .jumbotron at the top of the window?

Try setting scrollTop to $(this).offset().top.

https://api.jquery.com/offset/

Gwellin
  • 474
  • 1
  • 4
  • 8