6

I am using iScroll v4 in Phonegap 2.1.0 + IOS. I have a two iscroll in two different pages.

First iscroll

function locationload() {
    locationScroll = new iScroll('locationWrapper', {
        vScrollbar: false,
        hScrollbar: false,
        hScroll: false
    });   
}

Second iscroll

function preferenceload() {
    preferencesScroll = new iScroll('preferencesWrapper', {
        vScrollbar: false,
        hScrollbar: false,
        hScroll: false
    });
}

In first page iScroll worked fine. Second page iScroll also worked fine. but when i click a button in second page, button click event fire multiple times. If i remove the iScroll in second page, button click event works fine. I am using $.mobile.changePage("#Page2", null, true, true); to navigate to Page2.

I can't find any solution anywhere so I am hoping someone here can throw me some ideas.

Thanks

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
Palani Kumar
  • 1,137
  • 1
  • 10
  • 21
  • are you using jQuery Mobile? – whodeee May 06 '13 at 16:19
  • there are lots of questions about this related to JQM - from what I have experienced, they way to do this is `$('element').unbind("click").click( function() { //click code });` – whodeee May 06 '13 at 16:24
  • @whodeee Yes I use jQuery Mobile. – Palani Kumar May 09 '13 at 06:23
  • With what @whodeee said, try to destroy the iScroll after navigation away from the view. – Siddhartha Gupta Oct 11 '13 at 14:26
  • I have similar problem trying to use jQM tap, unbinding, trying to stop propagation and even using other JS libraries like hammer.js. so far nothing work and investing time researching people face similar problems and from what other says it is a very old bug even present in the latest jQM versions. – VicM Dec 29 '13 at 15:57

1 Answers1

0

I think you should try jquery-mobile-iscrollview

Hazem Hagrass
  • 9,329
  • 10
  • 32
  • 54