简体   繁体   English

jQuery iScroll:滚动不以内容结尾

[英]jQuery iScroll : Scroll doesn't end with content

I'm using iScroll for horizontal scroll for a list at the starting point it is behaving normal but when I scroll towards end (right to left) even my content ends but it will keep on scrolling to some extent. 我正在使用iScroll在列表的起点处进行水平滚动,这是正常的,但是当我向尾滚动(从右到左)时,即使我的内容也结束了,但是在某种程度上它将继续滚动。 I don't know what I'm missing in it Fiddle for the same is http://jsfiddle.net/mantrig/wvypmw0g/1/ 我不知道我在Fiddle中缺少的东西是http://jsfiddle.net/mantrig/wvypmw0g/1/

Below is my function initialization 下面是我的函数初始化

function loaded () {
 myScroll = new IScroll('#wrapper', { eventPassthrough: true, scrollX: true,    scrollY: false, preventDefault: false });
}
  #scroller {
      position: absolute;
      z-index: 1;
      -webkit-tap-highlight-color: rgba(0,0,0,0);
      width: 2400px;
      ...
}

you set the width 2400px; 您将宽度设置为2400像素;

http://lab.cubiq.org/iscroll5/demos/horizontal/ http://lab.cubiq.org/iscroll5/demos/horizo​​ntal/

this demo works cause it set the width of #scroller 5000px with 50*100px li. 此演示的工作原理是,它使用50 * 100px li设置了#scroller 5000px的宽度。

it's not Inline style. 它不是内联样式。 so it is not writed by iScroll ( javascript ); 因此它不是由iScroll(javascript)编写的;

but you have to set your #scroller yourself; 但是您必须自己设置#scroller

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM