解决 div 下面(屏幕下)内的滚动元素 - 我想在滚动后修复它
我不知道如何解决这种情况:
我的 html/css 看起来像这样: 显示我的 css/html 外观以及登陆页面后屏幕上显示的内容的图像:
>当我向下滚动时,我看到绿色元素: 向下滚动->
继续向下滚动后,我看到了完整的绿色元素,如果向下滚动,我想要这个元素就像CSS语言中一样:位置固定底部0。见下图: 我已经看到了完整的元素 ->相同的链接,但图像名为 Problem3.png
,然后我滚动到下面,我想将其固定在页面底部,如下图所示:
屏幕上的固定元素 - 我想要什么,但我不知道该怎么做 - >相同的链接,但图像名为 Problem4.png (愚蠢的垃圾邮件预防机制)
是否可以解决这种情况?
总结一下:我有两个 div,一个在上面,第二个在下面,当我向下滚动时,我突然看到另一个元素(绿色 div),当我继续向下滚动时,我想将这个绿色 div 固定在底部页。
当然,当我向上滚动(回到顶部)时,我想将那个绿色 div“停放在”第二个 div 的顶部。
有什么方法可以用 jQuery (Javascript) / html / css 解决这种情况吗?
先感谢您
I do not know how to solve this situation:
I`ve got the html/css looks like this:
Image showing how my css/html looks like and what is displayed on the screen after landing on page:
The when I scroll down I see green element:
scrolling down ->
After continuing to scrolling down I saw full green element and the if I scroll down I want to have this element like in css language: position fixed bottom 0. See image below:
I ve saw full element -> same link but image called problem3.png
and then I scroll below and I want to have it fixed at the bottom of the page, like on this image:
Fixed element on screen - What I want and I do not know how to do that -> same link but image called problem4.png (stupid spam prevention mechanism)
Is it possible to solve this situation ?
To sum up: I`ve got two divs, one above and second below, Wheen I scroll down I suddenly see another element (green div) and when i continue to scroll down I WANT TO HAVE THIS GREEN DIV FIXED AT THE BOTTOM OF THE PAGE.
Ofcourse, when I scroll up (back on the top) I want to "park" that green div at the top of the second div.
Is there any way to solve this situation with jQuery (Javascript) / html / css ?
Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你必须展示一些 html 结构。有很多方法可以达到这种效果。从根本上讲,用 JavaScript 术语来说,您将需要:
这听起来很复杂,但也不算太糟糕。 javascript 类似于:
请记住,我还没有测试过它或任何东西。
编辑 - 这是一个 演示
I think you'll have to show some of your html structure. There are lots of ways to achieve this kind of effect. Fundamentally, in javascript terms you'll be looking to:
That sounds complicated, but it's not too bad. The javascript would be something like:
Bear in mind I've not tested that or anything.
edit - here's a demo