freezeframe | R Documentation |
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.
use_freezeframe(
selector = "img[src$=\"gif\"]",
trigger = c("click", "hover", "none"),
overlay = FALSE,
responsive = TRUE,
warnings = TRUE
)
html_dependency_freezeframe()
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. |
An htmltools::tagList()
with the FreezeFrame dependencies, or an
htmltools::htmlDependency()
.
use_freezeframe()
: Adds FreezeFrame to your xaringan slides.
html_dependency_freezeframe()
: Returns an htmltools::htmlDependency()
with the
FreezeFrame dependencies for use in xaringan and R Markdown documents.
Most users will want to use use_freezeframe()
instead.
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() ```
http://ctrl-freaks.github.io/freezeframe.js/, https://github.com/ctrl-freaks/freezeframe.js/
use_freezeframe()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.