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

186
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 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