Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable animation when mobile #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Option to disable animation when mobile #39

wants to merge 1 commit into from

Conversation

gpeto91
Copy link

@gpeto91 gpeto91 commented Nov 4, 2016

As requested in #38

Initialization no longer occurs automatically. You need to declare a variable in your js, passing the scrollme object as value and call the init () method manually. The init function now receives a "disable_on_mobile" parameter to prevent the animations when mobile. Also added function to check whether it is a mobile device or not.

eg.:

script.js

    var s = scrollme;
    $(document).on( s.init_events.join(  ' '  ), function() { s.init("disable_on_mobile") } );

The parameter must be exactly the string "disable_on_mobile" or it will throw an error. Also if you want the plugin to work normally on mobile, just call the s.init() function without the parameter.

…variable in your js, passing the scrollme object as value and call the init () method manually. The init function now receives a disable_on_mobile parameter to prevent the animations when mobile. Also added function to check whether it is a mobile device or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant