Scroll does not work after append with jquery

Asked

Viewed 79 times

0

inserir a descrição da imagem aquiWell, I’m picking up posts when you load the page, but when I do a new post and give an append it goes to the end of the page and also it is half the scroll does not accompany, I tried everything with jquery but n scroll :/

Any help is welcome, obg and good night..

//Pega o post no bd
$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>";
  • By the image, you are using google Chrome. In this same browser, press CTRL+SHIFT+I to open the console. In the console you can see which errors happen.

  • does not point out any errors, not even with firebug

1 answer

1


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

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

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

I hope I’ve helped, and not confused more. :)

  • Thank you very much! now I will try to change the size of Overview.. I had even tried but didn’t think that this could be the cause of the problem.. I’m using the material design lite and a template of the same, I will restart the layout from scratch and pay attention to the details.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.