I have a problem with the scroll of my chatroom The scrollHeight all the time stays down and does not move to see the messages above
- what I want to do is move the scroll of the user so that I can see all the chat messages and stay where the user wants if someone can help me I appreciate it
-If you need all the file tell me ...
//tiempo real del chat 1000 es un segundo
setInterval("mostrar_enviado()",500);
mostrar_enviado();
//aqui nos deja ver el chat
function mostrar_enviado(){
var parametros = {
"pconsulta" : "mostrar_mensajes",
}
$.ajax({
data: parametros,
url: 'valida_ajax.php?v=<?php echo $id; ?>',
type: 'POST',
befforesed: function(){
},
success: function (response){
document.getElementById("mostrar_mensaje").innerHTML=response;
var abajo=$("#mostrar_mensaje").prop("scrollHeight");
$("#mostrar_mensaje").scrollTop(abajo)
}
});
}