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

182
Visualizações
Scroll only scrollable div and not page in Blazor Server

I've seen quite a few old posts with similar issues but haven't been able to quite find a solution that works for me. In my blazor server project I have a script that should scroll a div inside a component on pages. (timeline of events). This div should scroll on load (to bottom of items). Now if the timelone is not in view when it loads (lower down on page, this is by design) it would also bring the div into view (scroll the page down), where I only want the div to scroll to the bottom. This is what I currently use. What's the easiest way to only make the div scroll, and not the page even if the div isn't visible?

The reason I also specify an item in my script is that if events happen higher up (event status changes, etc) then it requires view, so it would scroll up to get to the item of focus. On page load, I would just specify the index of the last item.

 <script> 
        function ListViewScroll(args) { 
            let div = document.getElementById('lstTimeLine');
            div.querySelector('[data-uid="' + args.id + '"]').scrollIntoView({ behavior: 'smooth' });
        } 
</script>

Thanks so much for help in advance.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

To Mister Magoo's point, This is what worked for me:

function ScrollTimelineToBottom() { 
             let div = document.getElementById('lstTimeLine');
             div.scrollTop = div.scrollHeight;
        } ;

Sorry for the dup post.

about 4 years ago · Juan Pablo Isaza Relatório

0

You should use his css style in your page, so that your page do not have scrollbars and also do not scroll

html, body
{
    overflow-y: hidden;
}
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