Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!