获取 reveal.js
git clone https://github.com/hakimel/reveal.js
使用官方demo进行修改.
<!DOCTYPE lang="zh"> <html> <head> <meta charset="UTF-8" /> <title>reveal.js demo</title> <link rel="stylesheet" href="css/reveal.css" /> <link rel="stylesheet" href="css/theme/moon.css" id="theme"/> <!--[if lt IE 9]> <script src="lib/js/html5shiv.js"></script> <![endif]--> </head> <body> <div class="reveal"> <div class="slides"> <section> <h1>页面1</h1> <p>页面1 的描述</p> </section> </div> </div> <script src="lib/js/head.min.js"></script> <script src="js/reveal.js"></script> <script> Reveal.initialize({}); </script> </body> </html>
- 使用背景
<section data-background="path/to/svg.svg" data-background-size="960px"> </section>
- 缩放切入背景
<section data-background="path/to/img.jpg" data-background-size="460px" data-transition="slide" data-background-transition="zoom"> </section>
- 点击变淡消失
<section id="new-flow"> <p class="fragment fade-out">内容1</p> <p>内容</p> </section>
- 内嵌iframe
<section id="flow-chart"> <iframe data-src="path/to/example.html" width="960" height="730" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen> </iframe> </section>
- 代码支持
<section> <h2>标题</h2> <pre><code class="hljs" data-trim contenteditable> // 代码 </code></pre> </section>
- 支持markdown
<section data-markdown> <script type="text/template"> ```php /** * 这是代码 * * @param string code * @return string */ function code_something($code) { // TODO::something return $code; } ``` </script> </section>