$.scrollify.current() does not update correctly on page refresh
See original GitHub issueI’m using the before callback to add an active class to each section so I can update the z-index of the current section. If I’m looking at any section other than the first and I refresh the page and call the afterRender callback, the current method pulls the very first section instead of whichever one I’m looking at.
Setup looks like this:
$.scrollify({
section: ".section",
sectionName: false,
scrollSpeed: 1500,
setHeights: false,
updateHash: false,
before: function(index, sections) {
var ref = sections[index].attr('data-section-name');
$('.section').each(function() {
if( $(this).attr('data-section-name') === ref ) {
$(this).addClass('active-section');
}
else {
$(this).removeClass('active-section');
}
});
},
afterRender: function() {
console.log($.scrollify.current());
},
});
Also, I tried changing the easing to easeInOutQuad (and several others found on easings.net) and I get jquery-2.2.1.min.js:3 Uncaught TypeError: n.easing[this.easing] is not a function
when I try to scroll to the next/previous section. Separate issue, but thought I’d note it here while I’m at it.
Thanks for the plugin!
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Scrollify - on page refresh remains the same section
Am using scrollify.js latest version for page scroll effect and updateHash and sectionName are set to false . Here my issue is, post...
Read more >Submit a Form Without Page Refresh Using jQuery - Code
A great way to improve the user experience of your website is to validate and submit forms without a page refresh.
Read more >Scrollify - jQuery Cards
Scrollify is a jQuery Scrolling plugin. Created by Lukehaas. A jQuery plugin that assists scrolling and snaps to sections. Not what you're looking...
Read more >Scrollify - Bountysource
It opens the update() method up to being more current but more expensive, ... Scrollify still scrolling in background while mobile nav does...
Read more >jQuery Scrollify - Power steering for your scroll wheel - Projects
RunJS is a JavaScript playground that evaluates your code as you type and gives ... updateHash: A boolean to define whether Scrollify updates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Lukee , I can’t scroll to parts outside of the sections . I have a page with a header content body and a footer i only want the content body to be scrollify, when i do that i can’t scroll anymore to the header or footer … how can i fix it ?
Thanks Luke!