使用 jQuery 在 DOM 中添加项目,无需更新浏览器滚动条

发布于 2024-10-18 15:12:51 字数 146 浏览 9 评论 0原文

我添加了许多

    • ;使用 jQuery 和附加方法。
  • 当有更多的

  • 时,由于浏览器空间无法容纳,我希望垂直滚动条能够滚动,但它根本不显示。
  • 我在Firefox和Chrome中都试过了,效果是一样的。

    I am adding many <li> to a <ul> using jQuery with the append method.

    When there is more <li> than the browser space can accomodate, I expected the vertical scrollbar to enable scrolling but it doesn't show at all.

    I have tried this in Firefox and Chrome and the effect is the same.

    如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

    评论(2

    沉睡月亮 2024-10-25 15:12:51

    听起来你有一个CSS问题。滚动条由 css 溢出属性决定。

    尝试

    #myul {
      overflow:scroll;
    }
    

    #myul {
      overflow:auto;
    }
    

    it sounds like you have a css issue. Scrollbars are determined by the css overflow property.

    try

    #myul {
      overflow:scroll;
    }
    

    or

    #myul {
      overflow:auto;
    }
    
    神妖 2024-10-25 15:12:51

    最后,这个问题是由于我使用的ExtJS布局系统引起的......

    Finally, the problem was caused because of the ExtJS Layout system I was using...

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文