按固定位置的元素重叠页脚 [英] Overlapping of footer by element with fixed position
问题描述
我有侧边栏,其位置已固定。
当我滚动浏览器窗口时,我需要通过此侧边栏修复页脚重叠。
I have sidebar block, which has position fixed.
I need to fix overlapping of the footer by this sidebar when I scroll browser's window.
我试图将侧边栏的位置更改为绝对
,计算移动条件并将其移动到滚动事件窗口,但我快速滚动时它无法正常工作。
I tried to change the positioning of sidebar to absolute
, calculate conditions of movement and move it on scroll event of window, but it does not work correctly when I scroll fast.
如何在快速滚动窗口时修复此问题,或者建议是否有js插件?
How can I fix this, problem when scrolling the window fast, or, suggest if there is a js plugin for this?
更新:
小提琴: http://jsfiddle.net/c863E/1/
(页脚不应与侧边栏重叠)
(Footer should not be overlapped by sidebar)
推荐答案
我之前使用过以下插件执行此操作: http://www.profilepicture.co.uk/sticky-sidebar-jquery-plugin/
I've used the following plugin for this exact task before: http://www.profilepicture.co.uk/sticky-sidebar-jquery-plugin/
它工作得很好。
这里还有GitHub项目: https://github.com/pmp/jQuery-Stickybox
Also here is the GitHub project: https://github.com/p-m-p/jQuery-Stickybox
您需要的解决方案的一般术语是粘性侧边栏。有各种jQuery插件和教程,使用不同的技术来实现这种效果。谷歌搜索jquery sticky sidebar会显示很多。
The general term for the solution you need is a sticky sidebar. There are various jQuery plugins and tutorials with varying techniques for achieving this effect. A Google search for "jquery sticky sidebar" will reveal plenty.
这篇关于按固定位置的元素重叠页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!