javascript - Scrollify - on page refresh remains the same section -
am using scrollify.js latest version page scroll effect , updatehash , sectionname set false.
here issue is, post page refresh focus on same section left. example let in 4th section, when press f5 page has refreshed , landed on same 4th section instead of landing in 1st section. ctrl+f5 not helping in chrome browser. here code.
$('body').css('overflow', 'hidden'); $.scrollify({ section: ".scroll-section", sectionname: false, interstitialsection: "", easing: "easeoutexpo", scrollspeed: 1100, offset: 0, scrollbars: true, standardscrollelements: "", setheights: true, overflowscroll: true, updatehash: false, touchscroll: true, before: function(index, section) { var classname = '.' + $.scrollify.current().data('section'); $('.sticky-left-nav').find('li').removeclass('active mb30'); $('.sticky-left-nav').find(classname).addclass('active mb30'); if (index > 3) { $('body').removeattr('style'); } else { $('body').css('overflow', 'hidden'); } }, after: function() {}, afterresize: function() {}, afterrender: function() {} }); any appreciated. in advance.
it's not related plugin. when page offsettop set, after reload browser scroll last position. can see live here
you can solve scroll page top when page loaded.
$(window).on('load', function() { settimeout(function() { $(window).scrolltop(0); }); }); live demo here.
i'm not sure why need settimeout that's way works.
Comments
Post a Comment