简体   繁体   English

滚动图像不起作用

[英]scroll image doesn't work

The following codes are not working as intended. 以下代码无法正常工作。

index.html index.html

 #header { z-index: 2; height: 90px; width: 100%; min-width: 1060px; } #footer { position: absolute; z-index: 2; } #top-wrapper { overflow-x: auto; } #main-content { min-width: 1060px; position: absolute; overflow-y: auto; } #image-wrapper { padding-left: 20%; padding-right: 20%; width: 100%; height: 500px; } #coordinations { position: absolute; width: 100%; height: 500px; } 
 <div id="top-wrapper"> <div id="header"> <!-- some nav menu --> </div> <div id="main-content"> <div id="image-wrapper"></div> <div id="coordinations"></div> </div> <div id="footer"> <!-- some footer note --> </div> </div> 

The problem here is my scroll has the invisible #coordination div, which I can't make it into zero or get rid of (since it has all the coordinations I need to use on the #image-wrapper div). 这里的问题是我的滚动条具有不可见的#coordination div,我无法使其变为零或被除掉(因为它具有我需要在#image-wrapper div上使用的所有坐标)。

I tried to make invisible div on top #main-content div, so use the overflow-y but it doesn't work. 我试图在顶部#main-content div上设置不可见的div,因此请使用溢出-y,但它不起作用。 I tried to contain #main-content inside a bigger div and min-height to some x value. 我试图将#main-content包含在更大的div中,并将min-height设置为一些x值。 Still it doesn't work. 仍然不起作用。

Any possible way I can have #image-wrapper without the invisible content from #coordinations? 有什么可能可以让#image-wrapper没有#coordinations的不可见内容?

Update 更新资料

#coordinations
{
position:relative;
width:100%;
height:0px;
}

Sorry I didn't see this, but by changing position to relative and height to 0px. 抱歉,我没有看到这个,但是将位置更改为相对,高度更改为0px。 The coordination points or children of #coordinations are not affected. #coordinations的协调点或子级不受影响。

Thank you for your help. 谢谢您的帮助。

You already have #coordinations set as display: absolute , why not just move it off-screen with a left: -9999px; 您已经将#coordinations设置为display: absolute ,为什么不将它left: -9999px;移到屏幕外left: -9999px; ?

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

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