【发布时间】:2015-07-23 02:08:12
【问题描述】:
我不是在问如何制作背景图片,我知道该怎么做。我在问如何应用一个固定的背景,它在整个站点中保持不变而不移动。向上/向下滚动将在幻灯片内容中移动。 我当前的代码将背景图像设置为第一张幻灯片,随后的幻灯片为白色。
这是我目前所拥有的:
HTML:
<div id="fullpage">
<div class="section" id="section0" data-anchor="thisSection0">
<h1>Section0</h1>
</div>
<div class="section" id="section1" data-anchor="thisSection1">
<h1>Section1</h1>
</div>
<div class="section" id="section2" data-anchor="thisSection2">
<h1>Section2</h1>
</div>
</div>
CSS
#fullpage {
background-image: url('images/bg1.jpg');
}
脚本
$(document).ready(function(){
$("#fullpage").fullpage({
anchors: ['thisSection0', 'thisSection1', 'thisSection2'],
responsive: 900,
navigation: true,
navigationPosition: 'right',
navigationTooltips: ['Section 0', 'Section 1', 'Section 2']
});
});
【问题讨论】:
标签: javascript jquery html css fullpage.js