【发布时间】:2017-01-12 08:54:39
【问题描述】:
此向导有 3 个步骤。我想为这 3 个步骤之间的过渡设置动画。在第一步,用户可以单击“下一步”按钮。当他们这样做时,第 1 步的内容被下推并显示第 2 步。第 2 步还有一个用户可以单击的“下一步”按钮。点击时,step1和step 2的内容会翻转显示step 3的内容。
如果我使用绝对高度,我已经成功地让卡片在 Safari 中翻转。我已经能够让container 在 Safari 中根据需要动态增长。但是,我一直无法让这两个东西在 Safari 中协同工作。不过,我可以在 Chrome 和 Firefox 中这样做。
目前,我有以下Bootply。结构如下:
<section class="container">
<div id="card">
<figure class="front">
<div class="step-2-default" id="step2" style="overflow-x:hidden; padding:0.0rem 1.0rem;">
<label>Step 2</label>
<p>These are the details of the second step</p>
<button id="nextButton2">next</button>
</div>
<div class="step-1-default" id="step1">
<label>Step 1</label>
<p>These are the details of the first step</p>
<button id="nextButton1">next</button>
</div>
</figure>
<figure class="back">
<div id="step3">
<label>Step 3</label>
<p>Thank you for using this wizard</p>
</div>
</figure>
</div>
</section>
在这个 Bootply 中,卡片翻转工作。但是,container 渲染不正确。我试图让卡片后面的浅灰色背景随着卡片的增长而增长。当显示第 2 步时,背景应该会增长。但事实并非如此。我不能使用绝对高度,因为每一步的内容都是动态的。
我已经能够让背景动态增长。或者,我已经能够让卡片正确翻转。但是,我无法让它们在 Safari 中一起工作。
感谢任何帮助。
【问题讨论】:
-
它是否随着内容动态增长?
-
@DreamHunter 内容并没有增长。但是,它应该。
-
我已经用一个有效的 sn-p 编辑了我的答案。容器及其边距是响应式的。我只是使用了一个间隔 div 和自动高度。
-
我能问一下您为什么需要为此使用
position: absolute吗?