Giter Site home page Giter Site logo

Comments (4)

lukeshumard avatar lukeshumard commented on April 27, 2024

Personally, I think that the best way to handle iPhone / mobile is to unbind the plugin from scroll events. There are too many variables in devices to ensure that the plugin will work correctly, which is why I prefer the "twitter-style" approach, or manual trigger.

That said, if this works, awesome! I'll play around with it in the near future.

from infinite-scroll.

beebs93 avatar beebs93 commented on April 27, 2024

I still can't get the iPad to play nice - it's finicky as hell and I've just given up (for now).

The iPhone/iPod seems to still trigger the event with just width="device-width" so it's going in the right direction.

If you take out the meta tag entirely the event stops firing -- unless you zoom in manually.

Once the project goes live I'll post a link if that'll help.

Cheers,

-Brad

from infinite-scroll.

lukeshumard avatar lukeshumard commented on April 27, 2024

Which version of the plugin are you using? As I said in my previous post, I would highly advise to unbind from the scroll event and instead do a manual trigger. If you're using a 2.0b version, you can use the code below

$(document).ready(function(){

    // set up infinite scroll
    $('#container').infinitescroll({
        // insert your options here
    });

    // unbind infinite scroll from automatically
    // fetching the next page
    $('#container').infinitescroll('binding','unbind');

    // when the a tag (id 'load-more') is clicked,
    // fetch the next page
    $('#load-more').click(function(e){

        e.preventDefault();
        $('#container').infinitescroll('retrieve');

        // the plugin currently sets 'display:none' on your nav selector
        // this is probably going to change, but for the moment, just do this.
        $(this).css('display','block');

    });

});

from infinite-scroll.

beebs93 avatar beebs93 commented on April 27, 2024

Version: 1.5.100504

I'll keep the above in mind if we decide to switch to a manual trigger - thanks for the info! :)

from infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.