修改单个幻灯片的配置选项

Modify Config Option for an Individual Slide

我想要所有 reveal.js 个幻灯片 to start at the top,所以我将配置中的 center 选项修改为 false。但是,我想要一张特定的幻灯片来重新启用该配置。我可以在 <section> 括号中添加一些内容来修改它吗?像这样的东西(不起作用):

<section id="questions" data-markdown data-center="true">
        <script type="text/template">
            #Questions?
        </script>
</section>

类似于Hide slide number on title page的问题

您可以使用 data-state:

<section data-state="centerText" data-markdown>
    # Questions?
</section>

然后在<script>的末尾(Reveal.initialize()之后)添加以下内容:

Reveal.addEventListener( 'centerText', function() {
    Reveal.configure({center: true});
}, false ); 

这将使文本仅在具有 data-state="centerText" 的幻灯片中居中。