preventing all scroll events was not such an impressive idea after all...
This commit is contained in:
@@ -190,6 +190,16 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sometimes it's possible to trigger focus on first link with some keyboard action.
|
||||
// Browser in such a case tries to scroll the page to make this element visible
|
||||
// (even that body overflow is set to hidden) and it breaks our careful positioning.
|
||||
//
|
||||
// So, as a lousy (and lazy) workaround we will make the page scroll back to the top
|
||||
// whenever slide is selected
|
||||
//
|
||||
// If you are reading this and know any better way to handle it, I'll be glad to hear about it!
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
var step = el.stepData;
|
||||
|
||||
if ( $(".step.active", impress) ) {
|
||||
@@ -296,17 +306,6 @@
|
||||
select( getElementFromUrl() );
|
||||
}, false);
|
||||
|
||||
// Sometimes it's possible to trigger focus on first link with some keyboard action.
|
||||
// Browser in such a case tries to scroll the page to make this element visible
|
||||
// (even that body overflow is set to hidden) and it breaks our careful positioning.
|
||||
//
|
||||
// So, as a lousy (and lazy) workaround any scroll event will make the page scroll back to the top.
|
||||
//
|
||||
// If you are reading this and know any better way to handle it, I'll be glad to hear about it!
|
||||
window.addEventListener("scroll", function ( event ) {
|
||||
window.scrollTo(0, 0);
|
||||
}, false);
|
||||
|
||||
// START
|
||||
// by selecting step defined in url or first step of the presentation
|
||||
select(getElementFromUrl() || steps[0]);
|
||||
|
||||
Reference in New Issue
Block a user