Jquery 页面在横幅/jumbotron上滚动
所以我想重现这种效果: 当您开始滚动时,页面的实际内容会在jumbotron上滚动。 到目前为止,我没有做到这一点。 以下是我现在掌握的一些代码: HTMLJquery 页面在横幅/jumbotron上滚动,jquery,html,css,Jquery,Html,Css,所以我想重现这种效果: 当您开始滚动时,页面的实际内容会在jumbotron上滚动。 到目前为止,我没有做到这一点。 以下是我现在掌握的一些代码: HTML <div class="jumbotron"> <h1 style="text-shadow: 5px 5px 2px #000;">Team Divinity</h1> <div class="btn-group" role="group" aria-label="..."
<div class="jumbotron">
<h1 style="text-shadow: 5px 5px 2px #000;">Team Divinity</h1>
<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-default"><i class="fa fa-question"></i> About us</button>
<button type="button" class="btn btn-info"><i class="fa fa-share"></i> Share</button>
</div>
</div>
<div class="container">
<div class="news">
<div class="container">
<h2 style="text-align: center;">News</h2>
<div class="understroke"></div>
<div class="col-md-3">
<div class="thumbnail">
<a href="#" class="learnlink"><h3>Website V2.0</h3></a>
<p>We are currently working on the site, this message is currently being displayed manually but will later be displayed useing a data base</p>
<a href="#" class="btn btn-default">Read more</a>
</div>
</div>
</div>
</div>
<div class="games">
<div class="container">
<h2 style="text-align: center;">Games</h2>
<div class="understroke"></div>
<div class="col-md-6">
<div class="thumbnail">
<a href="#"><h3>Test 2</h3></a>
<a href="#"><img src="img/bg.jpg" class="thumbnail-image"></a>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<a href="#"><h3>Test</h3></a>
<a href="#"><img src="img/bg.jpg" class="thumbnail-image"></a>
</div>
</div>
</div>
</div>
</div>
使用
z-index
和fixed:position
可以实现这一点。
确保您的容器具有顶部边距。还要确保你给你的页眉100%的宽度,以使其拉伸页面。
更改您的容器
.jumbotron {
position:fixed;
top:0;
z-index:-1;
width:100%;
text-align: center;
color: #ebebeb;
background: url("/img/bg.jpg");
}
.container {
width: 93%;
margin-top:200px;
background:white;
}
当然,有很多方法可以达到这个效果,这只是一种方法 你应该问一个具体的问题。这是一个开始,虽然不是我真正想要的,但我想让jumbotron在屏幕分辨率改变时调整大小,有没有办法用jquiry解决这个问题?(再次参考)这不是一家我们可以根据您的要求制作任何东西的网店。如果你有一个问题,你可以发布这个具体的问题。告诉我们你试过什么。然后我们可以回答一个具体的问题。你的问题似乎是“我如何才能让标题移到主体内容后面。”你实际上写道:“当你开始滚动时,页面的实际内容会在jumbotron上滚动”,如果这回答了你的问题,那么接受它并问另一个问题。但是要具体点,否则没人能帮到你。对不起,我不太清楚,我对这样的论坛很陌生,我刚刚解决了这个问题,我不得不在css中添加一些东西,修改html,还有一点Jquiry。虽然你回答了我的问题,但谢谢你:)
.jumbotron {
position:fixed;
top:0;
z-index:-1;
width:100%;
text-align: center;
color: #ebebeb;
background: url("/img/bg.jpg");
}
.container {
width: 93%;
margin-top:200px;
background:white;
}