Scrolling automatically to a question | Experience Community
Skip to main content

Scrolling automatically to a question

  • Mar 2, 2023 9:56 PM UTC
  • 2 replies
  • 200 views

Forum|alt.badge.img+6
  • Level 2 ●●

Hi, I have a page with two questions. I want the page to scroll down to the second question on load. Is there a way to do it using js?

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Mar 2, 2023 10:02 PM UTC

You can use:
jQuery(".QuestionOuter").last().get(0).scrollIntoView();


Forum|alt.badge.img+6
  • Author
  • Level 2 ●●
  • Mar 2, 2023 10:26 PM UTC

Wow, thanks TomG. This was much easier than I thought!