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

Option for whether or not to initialize fullpage

rufengch opened this issue · comments

Hi,

I was wondering is it possible to add a feature so that I can decide in my controller whether or not to initialize fullpage.

For example, in my case, I only want to initialize fullpage when a user is using mobile device to visit my website.

Thank you!

Something you can do, since it is a directive, is use mobile detection on a users browser, and set a variable in your controller to true/false.

If the variable is true, then use an ng-if statement on the directive to activate it or not. if a directive is excluded from the dom using an ng-if statement, any link and controller code won't execute.

Another thing you can do is to detect window size, if you wanted to make your page responsive to this behavior.

Let me know if this solves your issue :)

I don't really want to put in an option to disable the plugin itself, since it should be treated as a directive, which is easy enough to turn on/off in this way.

That works. Thank you!