- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2021 08:15 PM
Hi,
I want to add SC Scroll to top widget in the portal.
How can I add?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2021 08:57 PM
The OOB SC Scroll to top widget works only on mobile devices.
I've stolen parts of the code to make it work for all devices.
Create a new widget and add below components:
HTML:
<button class="btn fa fa-arrow-up fa-lg padder-lg button-to-top pull-right" ng-click="goToTop()" ></button>
Client Controller:(Note: In your client controller, add spUtil as parameter to the main function)
$scope.goToTop= function()
{
spUtil.scrollTo('.sp-scroll', 300);
}
CSS:
.button-to-top {
position: fixed;
bottom: 0;
right: 0;
margin-right: 15px;
margin-bottom: 15px;
border-radius: 5px !important;
opacity: 0.7 !important;
padding: 12px !important;
border: 1px solid !important;
width: 47px;
height: 45px;
background-color: #ddd;
}
Add this widget to your page, and your functionality should be ready.
Long Live ServiceNow!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 01:38 AM
In case you still need an answer, just add it like this.