Scroll does not work after append with jquery

0

Well,I'mgettingpostswhenIloadthepage,butwhenIdoanewpostandIgiveanappenditgoestothebottomofthepageandalsoitstaysinthemiddlethescrolldoesnotfollow,Itriedeverythingwithjquerybutnroll:

Anyhelpiswelcome,okayandgoodnight..

//Pegaopostnobd$lastpost=DBRead('posts',"WHERE id = '". $id ."'", 'conteudo');
//Transforma o array em string
$postcont = (string)$lastpost[0]['conteudo'];
// esta função e de um outro script apenas para cercar o conteudo que veio
// do banco com html estilizado
$post = post($postcont);
// aqui eu dou o append para colocar o post no feed
echo "<script>$('div.overview').append(".$post.");</script>";
    
asked by anonymous 06.07.2016 / 07:43

1 answer

1

Your div.overview is not changing its size, so the scroll does not "work".

Imagine that your div.overview is 400px tall, and you make .append() of an object that, rendered, will be 600px tall. It will not necessarily expand its% container%.

The result will be like yours, a% container with a fixed height, and a larger content that will not be displayed - or will be, but will "leak" the div limits. But as div is the container, scrool will obey your measurements, and having no need to "scroll", will not do.

I hope I have helped, and not confused anymore. :)

    
06.07.2016 / 09:58