Yii2 Scroll Pager with overflow scroll

橙三吉。 提交于 2019-12-07 11:02:35

问题


i am using Yii2 with a scroll pager extension: http://kop.github.io/yii2-scroll-pager/

However, when you set the scroll for a div, instead of the whole screen, ajax is not loading any additional items when you scroll down.

Here's my code:

echo ListView::widget([
  'dataProvider' => $newsDataProvider,
  'itemOptions' => ['class' => 'item'],
  'itemView' => '_news_item_view',
  'pager' => [
    'class' => \kop\y2sp\ScrollPager::className(),
    'negativeMargin' => '200',
    'triggerText' => 'Load More news',
    'triggerOffset' => 3,
    'noneLeftText' => '',
    ],
    'summary' => '',
]);

But this is not working. You can see it live mode here: http://188.226.170.133/ on the div with id = w0

here's css i've added to make the scroll happen only on this div:

#w0 {
    height: 600px;
    overflow-y: scroll;
}

Any suggestions?

来源:https://stackoverflow.com/questions/25045168/yii2-scroll-pager-with-overflow-scroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!