我在页面的中间有一个固定的 div。我有另一个包含图像库的 div。目前,图像按预期滚动“低于”固定 div。但我想要一种图像永远不会隐藏在固定 div 下的效果。他们不会进入 div 之下,而是将它们分开,部分图像显示在下方,部分图像显示在上方。本质上,我希望将一个 div(带有图片库的那个)分成两部分,一部分显示在固定 div 下方,一部分显示在上方。这里有一些精美的图形可以更好地说明我希望做什么。
我很乐意使用所需的 css/html/javascript 的任何组合。
可能吗?
Current Behavior Desired Behavior
|===================| |===================|
| ===== ===== | | ===== ===== |
| | | | | | | | | | | |
| | img | | img | | | | img | | img | |
| | 1 | | 2 | | | | 1 | | 2 | |
| ===== ===== | | ===== ===== |
|===================| |===================|
| fixed div | | fixed div |
|===================| |===================|
| | 3 | | 4 | | | ===== ===== |
| ===== ===== | | | | | | |
| ===== ===== | | | img | | img | |
| | | | | | | | 3 | | 4 | |
| | img | | img | | | ===== ===== |
|===================| |===================|
滚动一点
|===================| |===================|
| | img | | img | | | | img | | img | |
| | 1 | | 2 | | | | 1 | | 2 | |
| ===== ===== | | ===== ===== |
| ===== ===== | | ===== ===== |
| | | | | | | | | | | |
|===================| |===================|
| fixed div | | fixed div |
|===================| |===================|
| ===== ===== | | | img | | img | |
| | | | | | | | 3 | | 4 | |
| | img | | img | | | ===== ===== |
| | 5 | | 6 | | | ===== ===== |
| ===== ===== | | | | | | |
|===================| |===================|
再滚动一点
|===================| |===================|
| ===== ===== | | ===== ===== |
| ===== ===== | | ===== ===== |
| | | | | | | | | | | |
| | img | | img | | | | img | | img | |
| | 3 | | 4 | | | | 3 | | 4 | |
|===================| |===================|
| fixed div | | fixed div |
|===================| |===================|
| | img | | img | | | ===== ===== |
| | 5 | | 6 | | | ===== ===== |
| ===== ===== | | | | | | |
| ===== ===== | | | img | | img | |
| | | | | | | | 5 | | 6 | |
|===================| |===================|