}
if (names[index]) {
scrollable = false;
- if (callbacks) {
- settings.before(index, elements);
- }
+
+ settings.before(index, elements);
+
interstitialIndex = 1;
//### DISABLED hash updates to URL
scrollTop: heights[index]
}, settings.scrollSpeed, settings.easing, function () {
$(window).scrollTop(heights[index]);
- console.log(heights[index]);
});
}
+var lastDotIndex;\r
+\r
registerLoader(load_home, true);\r
function load_home() {\r
$(window).on('fluidbookresize', resizeHome);\r
resizeHome();\r
initScrollify();\r
\r
+\r
// Bouncing scroll down arrow\r
// Show scroll-down arrow after a small delay\r
setTimeout(function () {\r
// Handle clicks on pagination dots\r
$(".pagination li").on("click", function () {\r
$.scrollify.move($(this).data('section'));\r
+ return false;\r
});\r
\r
// Disable scrollify when popups are open because it\r
interstitialSection: '.auto-height',\r
setHeights: false,\r
before: function (index, sections) {\r
+ lastDotIndex = index;\r
//fb("before: #" + index, sections.length);\r
\r
// Handle scrolling to last (footer) section\r
}, 300);\r
\r
}\r
+ // Pagination update\r
+ var ref = sections[lastDotIndex].attr('data-section-name');\r
+ $(".pagination .active").removeClass('active');\r
+ $(".pagination").find('[data-section="#' + ref + '"]').addClass('active');\r
+ },\r
+ after: function (index, sections) {\r
+ if (index !== lastDotIndex) {\r
+ return;\r
+ }\r
\r
// Pagination update\r
- var ref = sections[index].attr('data-section-name');\r
- var color = sections[index].attr('data-themecolor');\r
- $(".pagination .active").css('color', '').removeClass('active');\r
- $(".pagination").find('[data-section="#' + ref + '"]').css('color', color).addClass('active');\r
+ var ref = sections[lastDotIndex].attr('data-section-name');\r
+ $(".pagination .active").removeClass('active');\r
+ $(".pagination").find('[data-section="#' + ref + '"]').addClass('active');\r
},\r
afterRender: function () {\r
var pagination = '<ul class="pagination">';\r
+ var css = '';\r
\r
$('[data-section-name]').each(function (i) {\r
+ css += '.pagination li[data-section="#' + $(this).attr('data-section-name') + '"]:hover,.pagination li[data-section="#' + $(this).attr('data-section-name') + '"].active{';\r
+ css += 'color:' + $(this).data('themecolor') + ';';\r
+ css += '}';\r
pagination += '<li data-section="#' + $(this).attr('data-section-name') + '"><span class="hover-text">' + $(this).attr('data-section-name').charAt(0).toUpperCase() + $(this).attr('data-section-name').slice(1) + '</span></li>';\r
});\r
\r
pagination += "</ul>";\r
\r
+ pagination = '<style type="text/css">' + css + '</style>' + pagination;\r
$('body').append(pagination);\r
-\r
- // Highlight first dot\r
- $('.pagination li:first-of-type').css('color', $('[data-section-name]:first-of-type').data('themecolor')).addClass('active');\r
}\r
});\r
}\r