0

So I have a div footer on my page that lets say has a height of 200 pixels. Now this div has a button that reveals some html objects that are within the div and therefore increases the height of the div, to lets say, 400px.

So my div that was originally 200px is now 400px and is aligned to the bottom of the page. The problem is that when the div is expanded my browser doesnt automatically scroll down the window in order to show all the div. As a result, i only see the top 200 pixels of my div ( the original size ) and I have to manually scroll down my browser window in order to see the complete div.

Is there a way using html css that I can make my browser automatically scroll down when the div expands? If not, I guess it is possible with javascript at least..

slugster
  • 49,403
  • 14
  • 95
  • 145
Gonzalo_Arcos
  • 150
  • 4
  • 14
  • What have you tried so far? There's a lot of easy to use JS libs out there. Jquery could even do this for you. – ecnepsnai Sep 10 '14 at 20:05

1 Answers1

0

I don't know any solution with just html and css, you could try this javascript solution:

div = document.getElementById('#your_div');
div.scrollTo(0,div.scrollHeight);

Take a look at: Scroll Automatically to the Bottom of the Page.

Community
  • 1
  • 1