- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在做一个元素,我正在使用 Reveal JS 以幻灯片的形式向用户展示数据。
有时我发现文本溢出视口(viewport)。
因此,如图所示,文本不可见
我试过根据屏幕高度动态减小文本大小,如下所示:
var $present_section = $('section.present');
var section_bottom = $present_section.offset().top + $present_section.height();
var allowed_height = $(document).height() - $present_section.offset().top;
if (section_bottom > allowed_height) {
var cur_font_size = parseInt($present_section.css('font-size'));
$present_section.css('font-size', cur_font_size - 1);
}
在递归循环中运行这段代码会调整 <section>
的字体大小以适应文档高度。
有没有更好的方法或插件来处理这个问题而不减少幻灯片中的字符数?
最佳答案
定义CSS类scrollable-slide
:
.scrollable-slide {
height: 800px;
overflow-y: auto !important;
}
如果幻灯片太大,则定义将上述 CSS 类添加到幻灯片的监听器。为此,您将需要 jQuery。
function resetSlideScrolling(slide) {
$(slide).removeClass('scrollable-slide');
}
function handleSlideScrolling(slide) {
if ($(slide).height() >= 800) {
$(slide).addClass('scrollable-slide');
}
}
Reveal.addEventListener('ready', function (event) {
handleSlideScrolling(event.currentSlide);
});
Reveal.addEventListener('slidechanged', function (event) {
resetSlideScrolling(event.previousSlide)
handleSlideScrolling(event.currentSlide);
});
如果你想在可滚动时摆脱 box-shadow
和 background
,那么添加这些 CSS 样式:
.scrollable-slide::before {
background: none !important;
}
.scrollable-slide::after {
box-shadow: none !important;
}
引用资料:
关于javascript - 处理溢出的 Reveal JS 幻灯片的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35237862/
我一直有同样的问题——在 Reveal.js 中创建一组垂直幻灯片后,使用嵌套 Content Content 该垂直列表之后的下一张幻灯片无法正常工作。我的代码编辑器无法将其识别为 HTML,它
我正在使用 reveal.js进行演示。我正在使用 white 主题: 但是,最后一张幻灯片的主题应该是black。 我能做到吗?怎么办? 最佳答案 执行此操作的一个好方法可能是像这样在最后一张幻灯
我需要在同一页面上有多个模式窗口。基本上我打算有一个指向每个团队成员的链接,然后单击后会在模式框中弹出他们的详细信息。我正在使用 zurb 的 Reveal 插件。这是网站上的示例。 html:
在 Powerpoint 中,单击鼠标左键可前进到下一张幻灯片。在 reveal.js 中,它是使用键盘完成的。是否可以配置 reveal.js 在单击鼠标按钮时也前进到下一张幻灯片? 最佳答案 看起
到目前为止,我很喜欢 Reveal.js。不过,我遇到的一个问题是,我的无线演示 Remote 通常只能生成左/右箭头键击。我的 Reveal.js 幻灯片大量使用了它的二维功能以及片段。这意味着我的
我当前正在表格上使用“全部显示”按钮来显示所有表格条目: http://jsfiddle.net/SCpgC/ 但是,我想知道,有没有办法可以在单击时将“全部显示”切换为显示“较少显示”,以便用户可以
当 reveal.js 文件夹与 markdown 文件无关时,我无法使用 Pandoc 制作独立的 reveal.js 幻灯片。 一个简单的 Markdown 文件,Tester.md: # Tit
演讲者备注适用于默认的 reveal.js 演示文稿。 在我的演示文稿中,只要我添加 notes.js 依赖项,演示文稿就会停止工作。 我不知道是什么导致了这个问题。我测试了将默认演示文稿 index
我正在使用 Reveal.initialize({ slideNumber: true }) 是否可以隐藏扉页上的幻灯片编号? 最佳答案 我是这样做的: Reveal.addEventList
我有一个使用reveal.js 运行的演示文稿,一切正常。我正在编写一些示例代码,并且 highlight.js 在我的演示文稿中运行良好。但是,我想逐步显示代码。例如,假设我正在向您解释一个功能,我
有了reveal.js,不仅可以水平滑动,还可以通过垂直滑动添加第二个维度: slide1 slide2 A slide2 B slide2 C 但是,似乎只能从顶部的第一个小节开始(
假设我有一个简单的 reveal.js像这样滑动: Title Text Fragment 我想换 Text后颜色变为红色Fragment出现在屏幕上。我该怎么做? 最佳答案
我用 reveal.js 设置了一个演示文稿这意味着在无人看管的情况下使用。所以,我希望能够在所有指向“信息幻灯片”的幻灯片上显示一个小页脚(或其他地方的另一个链接),其中包含有关作者的数据、如何使用
我正在尝试使用reveal.js 进行演示。我尝试将图像添加到幻灯片中,但图像不会显示。这是我的代码 Slide Header Symptom:
我正在尝试使用语法高亮显示 reveal.js 中的演示文稿,但我不想使用 zenburn(默认设置),我想高亮显示用 R 编写的代码。我使用 highlight.js 生成为 R 定制的 css,但
我正在使用 Xaringan 编写演示文稿。我想嵌入视频,这样当我转换到包含视频的幻灯片时,它会自动全屏播放。 (即,我不想必须点击视频才能播放)。 我可以使用 revealjs 实现我想要的: ##
我已将幻灯片编号添加到我的展示 js 演示文稿中 Reveal.configure({ slideNumber: true }); Reveal.configure({
我尝试只在一个部分更改字体颜色,因为我添加了背景图片,否则您无法阅读白色: blablabla
我正在学习使用reveal.js,我发现它非常强大。 我想知道是否有可能在每次幻灯片转换时使显示播放声音。 我做了一个启用自动滑动选项的演示文稿,当幻灯片更改时发出声音会很有用。 有人能帮我吗 ? 谢
reveal.js 中默认使用哪个主题来高亮语法? 最佳答案 默认主题是 Zenburn,参见 index.html . 也可以在这里尝试 Zenburn:http://softwaremaniacs
我是一名优秀的程序员,十分优秀!