android - iScroll 4 not working properly -


I downloaded iScroll.js and used in one of my phonegap projects i.e. < Pre> & lt; Script type = "application / javascript" src = "iscroll.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Var myScroll; Function load () {myScroll = new ISCOL ('wrapper'); } Document.addEventListener ('DOMContentLoaded', loaded, false); & Lt; / Script & gt;

It also does not work on the normal browser, but when I inspect the elements then it is starting to work perfectly? Do not know what the problem is ...

How to use iScroll

1) Preventing the default behavior of standard touch events is easy to do by adding preventDefault () to your touchmove event

2 ) Start the iScroll object on DOMContentLoaded or Window Load.

Change your code,

  function loaded () {document.addEventListener ('touchmove', function (e) {e.preventDefault ();}); MyScroll = new ISCOL ('wrapper'); } Document.addEventListener ('DOMContentLoaded', loaded, false);   

Hope it helps.

Comments