Resize a div with button to a dynamically height, till all the content is visible?

Discussion in 'jQuery' started by nkamp, Nov 12, 2012.

  1. #1
    Hello,

    I quite new to JQuery. I have used it in the past with a few things. I know a lot of javascript.\

    I have a div intial with a certain height 200px and a fixed with 580px. The content in the div is more than that is visible, so on the right side of the div a scrollbar is visible.

    Now I want to make a button above the div, called "resize div", so the height of the div is faded-resized till all the content is visible and the scrollbar is removed. And if you click on the resize button again then the div is resized to his initial height 200px for example.

    I think I have today found an example of resizing but the content is dynamically. Today 30 lines and tomorrow 100 lines, so the content height is never the same. How can you the height of the div which is necessary to show all the content of the div. Or can this be done with autoresize?

    I hope that I'm clear enough, because I have this question put on the jQuery forum without any reaction.

    Thanks in advance. Any help would be appreciated.

    Nico.
     
    nkamp, Nov 12, 2012 IP