Jquery 超大-全屏背景-仅在一半上?
我想使用超大全屏背景 但我希望滑块只在网站的右半部分,在左半部分我希望有我的内容。当我滚动时,内容应该移动,背景保持不变。就像这里: 有人有主意吗 编辑:Jquery 超大-全屏背景-仅在一半上?,jquery,html,css,supersized,Jquery,Html,Css,Supersized,我想使用超大全屏背景 但我希望滑块只在网站的右半部分,在左半部分我希望有我的内容。当我滚动时,内容应该移动,背景保持不变。就像这里: 有人有主意吗 编辑: 好的,我知道了,但是我怎样才能使图像响应?有可能吗?如果使用开发工具浏览,您将看到以下内容: .supersized {position:fixed;width:50% top:0;bottom:0;} #supersized { position: fixed; right: 0; top: 0; over
好的,我知道了,但是我怎样才能使图像响应?有可能吗?如果使用开发工具浏览,您将看到以下内容:
.supersized {position:fixed;width:50% top:0;bottom:0;}
#supersized {
position: fixed;
right: 0;
top: 0;
overflow: hidden;
z-index: -999;
height: 100%;
width: 50%;
}
包含内容的DIV应该有一个溢出滚动条:
<style>
.content{
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 50%;
overflow: scroll;
}
.the-bg{
background-image: ...;
background-size: cover;
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 50%;
}
</style>
<div class="content">lorem ipsum</div>
<div class="the-bg"></div>
.内容{
位置:绝对位置;
左:0;
排名:0;
底部:0;
宽度:50%;
溢出:滚动;
}
.背景{
背景图像:。。。;
背景尺寸:封面;
位置:绝对位置;
左:50%;
排名:0;
底部:0;
宽度:50%;
}
乱数假文
或者,您可以将正确的一个固定:
<style>
.content{
float: left;
width: 50%;
}
.the-bg{
background-image: ...;
background-size: cover;
position: fixed;
left: 50%;
top: 0;
bottom: 0;
width: 50%;
}
</style>
<div class="content">lorem ipsum</div>
<div class="the-bg"></div>
.内容{
浮动:左;
宽度:50%;
}
.背景{
背景图像:。。。;
背景尺寸:封面;
位置:固定;
左:50%;
排名:0;
底部:0;
宽度:50%;
}
乱数假文