question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$.scrollify.current() does not update correctly on page refresh

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
richardnassar-externalcommented, Feb 23, 2018

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 ?

0reactions
dmcanaveralcommented, Dec 13, 2016

Thanks Luke!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found