jQuery(document).ready(function() {
$(window).bind('mousewheel', function(event) {
if (event.originalEvent.wheelDelta >= 0) {
var scrolledpx = parseInt($(window).scrollTop());
if (scrolledpx == 0) { hypeDocument.showPreviousScene(hypeDocument.kSceneTransitionPushTopToBottom, 1.1); }
}
else {
var scrolledpx = parseInt($(window).scrollTop());
if (scrolledpx >= 175) { hypeDocument.showNextScene(hypeDocument.kSceneTransitionPushBottomToTop, 1.1); }
}
});
});
when i am scrolling top (to the prev scene) its works like charm. but scrolling to the next screen does not take me to the “beginning” to the next screene, it stops somewhere the middle. why is that happens?
Hype retains the state of scroll between scenes as it’s attached to the window (scenes are only elements in the DOM) The way… as you have pointed out is to “reset” the scroll after every scene transition. You could do that in the way you’ve done or also on a scene load basis.