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

153
Views
How to scroll to bottom on click in angular

I want to scroll to bottom on clicking, I tried using scrollIntoView, it is scrolling till half of the page not till section of div

.ts file

@ViewChild("serviceBox", {static: false}) private serviceBox: ElementRef;

showService() {
 setTimeout(() => {
        this.serviceBox.nativeElement.scrollIntoView({behavior: 'smooth'})
    });
}
 

.HTML

 <div class="row" [style.display]="commonService.showService ? 'block' : 'none'">
        <div class="col-md-12">
            <div class="ticket__box" #serviceBox>
            <app-service-details [contractId]="contractId" [contactId]="contactId" [memberID]="memberID" [serviceId]="commonService.serviceId"></app-service-details>
        </div>
        </div>
       
    </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do it like this:

showService() {
  let position = document.getElementById("serviceBox").getBoundingClientRect().top + window.scrollY - 25;
  window.scrollTo({ top: position, behavior: 'smooth' });
}
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!