freezeframe {xaringanExtra} | R Documentation |
FreezeFrame
Description
FreezeFrame starts any gifs on a slide when you turn to that slide. This helps This helps alleviate the awkward pause that can happen when you turn to a slide with a gif that has already started and you have to wait until it loops back around. You can also directly click on the gif to stop or start it.
Usage
use_freezeframe(
selector = "img[src$=\"gif\"]",
trigger = c("click", "hover", "none"),
overlay = FALSE,
responsive = TRUE,
warnings = TRUE
)
html_dependency_freezeframe()
Arguments
selector |
The selector used to search for |
trigger |
The trigger event to start animation for non-touch devices.
One of |
overlay |
Whether or not to display a play icon on top of the paused
image, default: |
responsive |
Whether or not to make the image responsive (100% width),
default: |
warnings |
Whether or not to issue warnings in the browser console if an image doesn't appear to be a gif. |
Value
An htmltools::tagList()
with the FreezeFrame dependencies, or an
htmltools::htmlDependency()
.
Functions
-
use_freezeframe()
: Adds FreezeFrame to your xaringan slides. -
html_dependency_freezeframe()
: Returns anhtmltools::htmlDependency()
with the FreezeFrame dependencies for use in xaringan and R Markdown documents. Most users will want to useuse_freezeframe()
instead.
Usage
To add FreezeFrame to your xaringan
presentation,
add the following code chunk to your slides' R Markdown file.
```{r xaringanExtra-freezeframe, echo=FALSE} xaringanExtra::use_freezeframe() ```
References
http://ctrl-freaks.github.io/freezeframe.js/, https://github.com/ctrl-freaks/freezeframe.js/
Examples
use_freezeframe()