hellsan631 / angular-fullpage.js

An angular directive for fullpage.js

Home Page:http://hellsan631.github.io/angular-fullpage.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behavior when browser window gets resized

edzweistein opened this issue · comments

Problem

I was having trouble with sections (especially those that include slides) not positioning properly when I resized my browser window. (Firefox 43.0.4) Might be just me being new to AngularJS or just having weird layouting and CSS in combination with the fullpage directive?...

naive solution

Anyway if somebody else had problems with this, I solved the problem with rebuilding fullpage when there is a "resize" event from the $window object by adding these lines to the angular-fullpage.js script:

angular.element($window).bind('resize',function(){
rebuild();
});

I dont really know if this a real problem, but might be worth mentioning here ;)

Peace

Can you post a plunkr with some code that reproduces the problem? Resize works fine on chrome. If your loading in slides & sections dynamically, then I believe this problem comes into play: alvarotrigo/fullPage.js#1522

While building the plunkr demo I was quite confused because I could not reproduce the error...but then I investigated where the difference between my demo and my actual code was, so after quite a while I finally noticed that the problem with this strange behaviour, when resizing the browser window, was caused by an older version of fullpage.js.
In my plunkr demo I used 2.7.7 of fullpage.js and in my actual code I used bower to just install the angular-fullpage.js (version 0.2.0) package, which came with version 2.6.9 of fullpage.js as a dependecy.

So I suggest that the default version of fullpage.js, which the angular-fullpage.js bower package is dependent on, should be at least version 2.7.7, to address this issue?!

Here is my plnkr demo: choose the version of fullpage.js in the index.html header and spot the difference:

http://embed.plnkr.co/VxEOMJpJNYfOJhTaGc7D/

So the naive solution I proposed is not really fast and kind of only a workaround... it should not be used.
Instead using the newer version of fullpage.js seems better ;)

thanks for the insight and plunker @edzweistein

I've update the dependencies and pushed a new version, so that should provide some better compatibility.

With this angular project, I only really want it to be a wrapper to get the main functionality to work on page initialization and any dom changes caused by angular. So i would say that re-sizing would be one of those things that would fall in line with being an error in the main repo, since the dom isn't changing at all. Good to hear that its fixed in the newest version!

nice one 👍 no problem... I am happy, if that was helpful ! :) peace