Created
June 13, 2018 06:28
-
-
Save fabianneve/da8b6484780acf4332a0d85e22180ffe to your computer and use it in GitHub Desktop.
Table of Content for SharePoint Pages - https://fneve.blogspot.com/2017/10/table-of-content-for-sharepoint-pages.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Fabian Neve / http://fneve.blogspot.ch/ | |
// Date: 18.09.2017 | |
// With input from https://blog.sharepointexperience.com/2014/10/sticky-stuff-in-sharepoint/ | |
// | |
// Top alignment of ToC has to be defined in sp.tableOfContents.css under #s4-workspace.scroll .right-wp-zone-col | |
var wrap = $("#s4-workspace"); | |
wrap.on("scroll", function(e) { | |
if (this.scrollTop > 116 ) { | |
wrap.addClass("scroll"); | |
} else { | |
wrap.removeClass("scroll"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment