From 49c5906bc8846ca13f948cc0724462a5c8989534 Mon Sep 17 00:00:00 2001 From: Ouadie BOUSSAID Date: Tue, 14 Jan 2014 14:04:24 +0100 Subject: [PATCH] Sections to skip Add possibility to specify the ids of sections to skip. --- windows/js/jquery.windows.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/windows/js/jquery.windows.js b/windows/js/jquery.windows.js index 9129ced..8bd778c 100644 --- a/windows/js/jquery.windows.js +++ b/windows/js/jquery.windows.js @@ -15,6 +15,7 @@ var that = this, snapping: true, snapSpeed: 500, snapInterval: 1100, + sectionsToSkipArr:[], onScroll: function(){}, onSnapComplete: function(){}, onWindowEnter: function(){} @@ -125,6 +126,8 @@ var that = this, var $visibleWindow = _getCurrentWindow(), // visible window scrollTo = $visibleWindow.offset().top, // top of visible window completeCalled = false; + if($.inArray($visibleWindow.attr("id"), options.sectionsToSkipArr ) >= 0) + return; // animate to top of visible window $('html:not(:animated),body:not(:animated)').animate({scrollTop: scrollTo }, options.snapSpeed, function(){ if(!completeCalled){ @@ -158,4 +161,4 @@ var that = this, }); }; -})( jQuery, window, document ); \ No newline at end of file +})( jQuery, window, document );