Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda