使用scrollTop()时如何加长滚动?(How to lengthen scroll when using scrollTop()?)

编程入门 行业动态 更新时间:2024-10-24 19:17:26
使用scrollTop()时如何加长滚动?(How to lengthen scroll when using scrollTop()?)

我目前在我的网站上使用scrollTop()方法。 它在我的屏幕上工作正常但我意识到当主页在更大的屏幕上时,滚动条不会向下滚动。 有没有办法来解决这个问题?

I'm currently using a scrollTop() method in my website. It works fine on my screen but I realized that when the homepage is on a bigger screen, the scrollbar will not scroll down. Is there a way to fix this?

最满意答案

enter code here无需编辑滚动功能,您只需确保您的身高。 它至少应该是50px>你的窗口高度。 你的$(文件).ready里面加上这个:

$("body").css("height", window.outerHeight + 50 + "px")

IE:

$(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); $("body").css("height", window.outerHeight + 50 + "px") });

enter code hereWithout editing your scroll function you only need to ensure your body height. It should be at least 50px > your window Height. Inside of your $(document).ready add this:

$("body").css("height", window.outerHeight + 50 + "px")

IE:

$(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); $("body").css("height", window.outerHeight + 50 + "px") });

更多推荐

本文发布于:2023-07-05 06:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034362.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:scrollTop   lengthen   scroll

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!