Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
This attribute work but id attribute not work in jQuery

I will use ajax for input messages and append that message but I want scroll bottom to chat but simple document ready - scroll top function does not work

Here is the working code

 $(document).ready(function(event){
        $('#chatboxouter').mouseenter(function (event) {
        event.preventDefault()
         $(this).scrollTop(400);
        
        
      });
      });

But not work in

$(document).ready(function(){
        
         $('#chatboxouter').scrollTop(400);
});
        

Here is CSS code:

#chatboxouter{
        position: fixed;top: 80px;height: 80vh;width: 100%;
overflow-y: scroll;background-color: navy;
      }

here Is the html code

<div class="mainouter" style=" position: fixed;top: 80px;height: calc(100vh - 160px);width: 100%;
background-color: red;">


<div class="chatboxouter" id="chatboxouter">
<div class="allmessageview" style="background-color: yellow;">
  Here Php input by ajax
</div></div>


</div>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you don't mind you can use javascript like:-

<script>
     document.querySelector(document).ready(function(){
         document.querySelector('#chatboxouter').scrollTop(400);
     });
</script>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda