我有一个奇怪的问题,我猜它有一个非常简单的解决方案,但我似乎找不到它。我正在使用this教程开始我的第一个reveal.js幻灯片。本教程中的代码为:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Reveal.js 3 Slide Demo</title>
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<!--Add support for earlier versions of Internet Explorer -->
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<!-- Wrap the entire slide show in a div using the "reveal" class. -->
<div class="reveal">
<!-- Wrap all slides in a single "slides" class -->
<div class="slides">
<!-- ALL SLIDES GO HERE -->
<!-- Each section element contains an individual slide -->
<section>
<h1>About My Product</h1>
<p>My product discussed here</p>
</section>
<section id="show-a-link">
<h1>Show a live link</h1>
<p>Slide 2 discussed here</p>
<p>See <a href="http://www.htmlcheats.com">HTMLCheats.com</a><p>
</section>
<section>
<h1>Slide 3</h1>
<p>How does one revisit an arbitrary slide in code?</p>
<p>Visit internal slide<a href="#/show-a-link"> 2</a>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Required, even if empty.
Reveal.initialize({
});
</script>
</body>
</html>我将代码保存到一个index.html文件中,并将其与其余的显示文件和文件夹放在一起。双击它时,它会在浏览器中打开,所有内容都会呈现出来,但不会放映幻灯片。取而代之的是,所有的幻灯片内容都呈现在一个幻灯片中,没有导航控件。
当双击Hakim的索引文件(来自github的演示演示文件,位于与我的html文件相同的目录中)时,它运行得很好,并且达到了预期的效果。我尝试将上面的代码复制粘贴到Hakim的示例中,但同样的问题也出现了。我在这里做错了什么?代码是教程代码,看起来很好,文件位于适当的环境中,可以找到所有的揭示库和css,那么为什么它不能幻灯片显示呢?
发布于 2014-02-24 08:19:40
由于本例和每个基于reveal.js的幻灯片都需要在download环境中运行,因此您需要从主页下载reveal.js代码,并将index.html放入该目录。
一切都会好起来的。
从index.html代码中,您可以找到对reveal.min.css等css文件的引用。
<link rel="stylesheet" href="css/theme/default.css" id="theme">这意味着css/ this /default.css应该存在,那么这个页面就会像设计一样工作。否则,它只能将其显示为普通的html文档。
https://stackoverflow.com/questions/21653814
复制相似问题