Anchor Points on the Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 03:38 PM
Hello - pretty new to coding. My company is on Helsinki, and we have an end user Portal. I have created some anchor points in a knowledge article using the method here: ServiceNow Knowledge: Create Anchor (Internal) Links in an Article | IT@UMN
The good news is that it worked when I viewed the article from ServiceNow (Fulfiller side). However, when I go to the same document from our Portal, the anchors act strange. The links go to the anchors, but after about 2-5 seconds, the page automatically redirects to the top of the article. In other words, the webpage will not stay where the anchor is located in the article, and you can't really use the links to navigate because they keep taking you to the top of the article. Does anyone have a clue why anchors in Knowledge articles don't work the same on Fulfiller vs Portal side, and maybe have a solution? Thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2017 06:12 AM
spUtil.scrollTo("#theIDtoScrollTo"); would be a great solution if just scoll to the right place, any idea why? I tried it in my widget and also saw in the order guide widget that sometimes scroll to the wrong place.
thanks, I'll try to add the $anchorScroll to the theme.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2017 08:48 PM
Hi,
I tried the below code and it worked.
var elmnt = document.getElementById("content");
elmnt.scrollIntoView();
More information can be found at https://www.w3schools.com/jsref/met_element_scrollintoview.asp
Regards,
Subhash Uniyal