0

Anyone know how to automatically scroll down to footer section when a specified div clicked using jquery ?

stackminu
  • 643
  • 1
  • 6
  • 20
  • actually you should do more research before asking ;) http://stackoverflow.com/questions/6677035/jquery-scroll-to-element – p0rter Jul 24 '12 at 10:45
  • here is an example of what you are looking for http://tympanus.net/codrops/2010/01/03/scrolling-to-the-top-and-bottom-with-jquery/ – Vinay Jul 24 '12 at 10:46
  • `$(window).scrollTop(99999);` 99999 or a high value – Imdad Jul 24 '12 at 10:49

3 Answers3

1

you can do it by jQuery.ScrollTo by giving id to your footer section, check the demo.

Arun Rana
  • 8,082
  • 14
  • 63
  • 105
0

This should do it.

$('#clickableItem').bind('click', function () {
  // get the distence left and top from the document left and top sides
  var _offset = $('#footer').offset(); 
  $(window).scrollTop(_offset.top);
};
bkwint
  • 628
  • 4
  • 9
0

$("body").height() will calculate the height of the window and if you assign the height value to the scrollTop attribute of your html/body job is done

$('html, body').scrollTop($("body").height());
swapnilsarwe
  • 1,250
  • 1
  • 8
  • 13