Skip to content

Commit

Permalink
- Destroy unbinds resize event #711
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarotrigo committed Sep 16, 2014
1 parent f23ddca commit 88b1b15
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
13 changes: 7 additions & 6 deletions jquery.fullPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* fullPage 2.2.7
* fullPage 2.2.8
* https://github.com/alvarotrigo/fullPage.js
* MIT licensed
*
Expand Down Expand Up @@ -1054,11 +1054,11 @@
slidesNav.find('li').eq(slideIndex).find('a').addClass('active');
}

//when resizing the site, we adjust the heights of the sections, slimScroll...
$(window).resize(resizeHandler);

var resizeId;

//when resizing the site, we adjust the heights of the sections, slimScroll...
$(window).resize(function() {
function resizeHandler(){
// rebuild immediately on touch devices
if (isTouchDevice) {
$.fn.fullpage.reBuild();
Expand All @@ -1069,7 +1069,7 @@

resizeId = setTimeout($.fn.fullpage.reBuild, 500);
}
});
}


/**
Expand Down Expand Up @@ -1578,7 +1578,8 @@

$(window)
.off('scroll', scrollHandler)
.off('hashchange', hashChangeHandler);
.off('hashchange', hashChangeHandler)
.off('resize', resizeHandler);

$(document)
.off('click', '#fp-nav a')
Expand Down
Loading

0 comments on commit 88b1b15

Please sign in to comment.