Question

How to implement BackToTop function

Does pega have any OOTB BackToTop function, or any other anchor link function?

I made one anchor link by javascript.

The code is simple, such as following one

function topFunction() {
location.href = "#top";
}

The code is simple, such as following one

When client click the anchor link, that function will be triggered.

This function works totally well in PC view, but when I try in iPad Safari, it doesnt work well.

The javascript itself is called, but the page doesnt scroll properly.

Do you have any solution to fix that?

***Moderator Edit-Vidyaranjan: Updated Platform Capability***

Comments

Keep up to date on this post and subscribe to comments

Pega
August 9, 2019 - 2:34am

Hi,

I am not aware of any OOTB function for this requirement. 

However, you can write your own function and call  window.scrollTo(0,0);  and check

 

Thank you. 

Pega
August 14, 2019 - 2:54am
Response to mojjs

Hi

Thank you for your solution, I tried it, but it didn't work.

In my case, the expectation of function BackToTop is back to the top of the body content.

Because the header position is fixed, and when you scroll down, only body content part is scrolled...