search

Home  >  Q&A  >  body text

Front-end - How angularJS uses isscroll4 to achieve page scrolling effect

Use the project created by yeoman, then download the iscroll4 from bower, and call it directly with native js

var myScroll;
function loaded(){
    myScroll = new iScroll('wrapper');
}
document.addEventListener('touchmove', function(e){
    e.preventDefault();
}, false);
document.addEventListener('DOMContentLoaded', function(){
    setTimeout(loaded, 200);
}, false);

But it has no effect. . .
I am new to angularJS, and the teacher who tutors me is very busy now. So I would like to ask you for advice on how to use it.
Console error: Uncaught ReferenceError: IScroll is not defined

大家讲道理大家讲道理2844 days ago637

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-15 16:56:56

    1. If there is no error in the console, it should be a style problem. I have used iscroll5,知道它要求滑动的元素需要特定的定位
    你可以看看iscroll4是不是也有这方面的需求;另外,iscroll5portal

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 16:56:56

    https://github.com/ibspoof/ng...
    Look at this demo. Can be solved perfectly

    reply
    0
  • Cancelreply