scrollintoview | XM Community
Skip to main content

I have 4 questions on a page (the firs two are text/graphic while the last two are multiple choice). On load, I want the second question to scrollintoview. 

I learned (from this forum), that I can use 

jQuery(".QuestionOuter").last().get(0).scrollIntoView(); 

to automatically scroll to the last question on the page. However, I can’t seem to figure out a way to modify the code to scroll to the second question… I have used different integer indexes in get(), but those don’t seem to achieve what I want. 

Any help is appreciated!

@pb7 

Try this:

jQuery('.QuestionOuter').eq(1).get(0).scrollIntoView();

Hope it helps!


Thanks @Deepak. This works perfectly!


Leave a Reply