lukehaas / Scrollify

A jQuery plugin that assists scrolling and snaps to sections.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After editing site (removing sections), pagination still has the previous sections

cordial opened this issue · comments

Here are our settings -

jQuery(document).ready(function($) {

$.scrollify({
section: ".section_wrap",
sectionName: "section-name",
interstitialSection: "#copyright",
easing: "easeOutExpo",
scrollSpeed: 1100,
offset: 0,
scrollbars: true,
standardScrollElements: ".section-team, .section-projects",
updateHash: false,
before: function(i, panels) {
var ref = panels[i].attr("data-section-name");
$(".pagination .active").removeClass("active");
$(".pagination").find("a[href="#" + ref + ""]").addClass("active");
},
after: function() {},
afterResize: function() {},
afterRender: function() {
var pagination = "<ul class="pagination">";
var activeClass = "";
$(".panel").each(function(i) {
activeClass = "";
if (i === $.scrollify.currentIndex()) {
activeClass = "active";
}
pagination += "

  • <a class="" + activeClass + "" href="#" + $(this).attr("data-section-name") + ""&gt;&lt;span class="hover-text"&gt;" + $(this).attr("data-section-name").charAt(0).toUpperCase() + $(this).attr("data-section-name").slice(1) + "
  • ";
    });

      pagination += "</ul>";
    
      $(".home").append(pagination);
      $(".pagination a").on("click", $.scrollify.move);
    }
    

    });

    For some reason, the 'panels' variable in the before method still has 6 sections and 6 are still showing on the site, instead of now having 4. There are only 4 instances of 'section_wrap' in the html. Is that where the variable 'panels' is created from?

    You can see the issue here -
    https://cooper-collective.com/