【问题标题】:Detect if the select box scroll bar has reached to bottom检测选择框滚动条是否到达底部
【发布时间】:2014-03-24 08:01:28
【问题描述】:

我有一个选择下拉菜单,当滚动条到达底部但无法加载时,我想在其中加载更多选项。我使用了以下代码,但这对我不起作用

$(function () {
             var $win = $('#CouponProduct_0_id_brand');

             $win.scroll(function () {
                 if ($win.scrollTop() == 0)
                     alert('Scrolled to Page Top');
                 else if ($win.height() + $win.scrollTop()
                                == $(document).height()) {
                     alert('Scrolled to Page Bottom');
                 }
             });
         });

【问题讨论】:

  • 我建议您将您的选择转换为小部件 - 没有一种安全的方法来检测您要检测的内容

标签: jquery html html-select


【解决方案1】:

Found your answer here

我建议不要自动加载更多列表项,而是放置一个按钮,用户可以点击以加载更多(但这只是我的建议)。Reference

Check out this pulgin

【讨论】:

  • 这违背了动态html的目的。如果只是一个建议,不应该作为答案发布吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-15
  • 1970-01-01
  • 1970-01-01
  • 2021-09-22
  • 2020-11-14
  • 1970-01-01
相关资源
最近更新 更多