Cannot scroll to top

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Dan_C
Posts: 63
Joined: Tue Dec 02, 2014

22 Jul 2016

I have my form inside a tab control and next buttons disabling tabs and switching to the next tab. I have one tab that's longer than the next so when I click next at the bottom the tab switchesfine, but I have to scroll up to see the new active tab. Trying to avoid this by scrolling to the top with the next button click as well.



Tried all of these and none seem to work:

window.scrollTo(0, 0);

window.scrollBy(0, -100);

$("html, body").animate({ scrollTop: 0 }, 600);

window.location.href = "#top"; //href at the top



No errors in console other than this:

https://services.spform.com/CSL/scripts ... e_en_us.js

But that is showing on all my forms and doesn't seem to cause any problems.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

25 Jul 2016

Hi,

Please, try the following code:

Code: Select all

$('#s4-workspace').scrollTop(0);

Dan_C
Posts: 63
Joined: Tue Dec 02, 2014

25 Jul 2016

Works. You're a great help. Thanks.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests