How to capture scroll start event on iPhone/Android

后端 未结 3 1242
我寻月下人不归
我寻月下人不归 2021-01-07 02:22

I\'m using JQuery with a mobile site to reposition the header nav on scroll in the absence of position:fixed support. That works fine, when the user stops scrolling the head

相关标签:
3条回答
  • 2021-01-07 02:35

    This scrollstart event is faulty in the default android browser for android 2.3.4 The scrollstart event doesn't fire 100% of the time when the user starts a scroll. I am trying to track down problem. I am looking for any event that fires just before the scrollstart event. It could also be a conflicting event somewhere in my code. I need to rule that out first.

    0 讨论(0)
  • 2021-01-07 02:40

    I believe jQuery Mobile, can do this. Take a look at the following code:

    $(document).bind("scrollstop", function() {
    
    //What occurs when the scrolling stops
    alert("You have stopped scrolling");
    });
    
    $(document).bind("scrollstart", function() {
    
    //What occurs when the scrolling starts
    alert("You have started scrolling");
    
    });
    
    0 讨论(0)
  • 2021-01-07 02:51

    You can start with jQuery Touchwipe : it's a plugin which add new events, wipeleft and wiperight.

    It can be easily modified to change horizontal wipes to vertical ones (changing x's to y's) http://plugins.jquery.com/project/Touchwipe-iPhone-iPad-wipe-gesture

    It works on Android, IOS and BBOS.

    0 讨论(0)
提交回复
热议问题