简体   繁体   English

画布上的滚动与页面分开

[英]Off-Canvas Scrolling Separately from Page

So I've run into probably a very simple issue to fix as I've seen it done on so many mobile sites with their navigation. 因此,我遇到了一个非常简单的问题,因为在许多移动网站的导航中都看到了这一问题。 On my mobile site I am using the Foundation Off-Canvas "plug in" that they offer to handle my navigation. 在我的移动网站上,我正在使用他们提供的Foundation Off-Canvas“插件”来处理我的导航。 However, I've run into the issue that when I open it and start to scroll through the navigation, the page that the off-canvas is laying on top of also starts scrolling. 但是,我遇到了一个问题,当我打开它并开始滚动浏览时,画布上方的页面也会开始滚动。 Is there a prevent default action I can place on the content to prevent the page behind the Off-Canvas navigation from scrolling along with the navigation? 是否可以在内容上放置阻止默认操作,以防止“画布外”导航后面的页面随导航一起滚动?

As far as code goes, everything is straight from foundation. 就代码而言,一切都是基础。 I haven't manipulated much other than how the navigation looks in the styles. 除了导航在样式上的外观外,我没有做太多其他的事情。 Functionality is still all the same. 功能仍然相同。 And it's coming from the left side of the page if that helps at all. 如果有帮助的话,它来自页面的左侧。

I don't know if this helps, but try to search for 我不知道这是否有帮助,但请尝试搜索

posistion: fixed;

in the navigation's css file and change it to 在导航的css文件中并将其更改为

posistion: absolute;

or 要么

posistion: relative;

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

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