Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions smartscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@
var sectionWrapperIsVisible = function () {
var windowTop = getWindowTop();
var windowBottom = windowTop + $(window).height();
var pageHeight = $(document).height();

// Only affect scrolling if within the sectionWrapper area
if (windowBottom === pageHeight) {
return false;
}
if (
windowBottom > sectionWrapperTop
&& windowTop <= sectionWrapperBottom
Expand Down Expand Up @@ -302,6 +307,7 @@
if (
windowBottom > sectionWrapperTop
&& windowTop <= sectionWrapperBottom
&& sectionWrapperIsVisible()
) {
// Only hijack the scroll when windowTop and windowBottom are touching different slides
// `!==` instead of `<` caters for when `getSectionIndexAtWindowBottom` is `undefined`
Expand Down
2 changes: 1 addition & 1 deletion smartscroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.