简体   繁体   English

按固定位置的元素重叠页脚

[英]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. 我试图将侧边栏的位置更改为absolute ,计算移动条件并将其移动到窗口的滚动事件上,但是当我快速滚动时它无法正常工作。

How can I fix this, problem when scrolling the window fast, or, suggest if there is a js plugin for this? 如何在快速滚动窗口时修复此问题,或者建议是否有js插件?

Update: 更新:

Fiddle : http://jsfiddle.net/c863E/1/ 小提琴: http//jsfiddle.net/c863E/1/

(Footer should not be overlapped by sidebar) (页脚不应与侧边栏重叠)

I've used the following plugin for this exact task before: http://www.profilepicture.co.uk/sticky-sidebar-jquery-plugin/ 我之前使用过以下插件来完成这项任务: http//www.profilepicture.co.uk/sticky-sidebar-jquery-plugin/

It worked perfectly. 它工作得很好。

Also here is the GitHub project: https://github.com/pmp/jQuery-Stickybox 这里还有GitHub项目: https//github.com/pmp/jQuery-Stickybox

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. 有各种jQuery插件和教程,使用不同的技术来实现这种效果。 A Google search for "jquery sticky sidebar" will reveal plenty. Google搜索“jquery sticky sidebar”将会发现很多内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM