【发布时间】:2016-03-30 16:34:40
【问题描述】:
默认情况下,编写 fullpage.js 的任何示例以在屏幕的最大高度和宽度(全屏)处呈现幻灯片。
但是,我试图在我的 html 页面中将幻灯片包含在一个固定大小的 div 中。我有一个固定高度和固定宽度的 div,并希望 fullpage.js 幻灯片在该 div 中播放。我试过了,但我无法将高度降低到规定的固定高度。固定宽度工作正常。
<div id="fullpage" style="height: 40px; max-height:200px; width: 500px;">
<div class="section " id="section0">
<div class="intro">
<h1>Responsive</h1>
<p>This example will turn to normal scroll when the window size gets smaller than 600px height</p>
</div>
</div>
<div class="section" id="section1">
<div class="slide" id="slide1">
<div class="intro">
<h1>Ideal for small screens</h1>
</div>
</div>
<div class="slide" id="slide2">
<h1>This example uses responsiveHeight: 600</h1>
</div>
</div>
<div class="section" id="section2">
<div class="intro">
<h1>Keep it simple!</h1>
</div>
</div>
</div>
【问题讨论】:
-
使用 fullpage.js 时,高度是在 js 中设置的。所以除非你改变它的源代码,否则你不能改变高度
标签: javascript jquery css fullpage.js