I am creating my first HTML - presentation with rmarkdown (ioslides) and would like to be able to manually zoom into a slide and navigate to an object.
Zooming works fine in a browser (crtl +, crtl mouse wheel) but I can not move the slide. Neither with the mouse nor with scrollbars. The latter do not appear as they do e.g. on a website.
Is there an appropriate way to implement such a thing or are ioslides not meant to be used like this?
I am using Ubuntu 16.04 (LXDE) and rstudio (R version 3.2.3). I tried zooming and navigating in Firefox and Chromium.
example:
---
title: Zooming into an ioslide
author: "Robatt"
output:
ioslides_presentation:
fig_caption: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
##The slide to zoom in and navigate
```{r fig.align='left', out.width = "100px", dpi=300,
fig.cap="a small graph to zoom in, when necessary"}
library(ggplot2)
x=c(1:30,by=0.1)
y=x/(1+x)
ggplot()+
geom_smooth(aes(x=x,y=y),se=F,span=0.15,color="grey20")+
labs(x="you can only read me after zooming in")
```
This also is the first time that I did not find an answer on stackoverflow and consequentially my first entry.
I assume that your question is mainly about how you could zoom in on some tiny plots. Here is a solution using jQuery:
We basically add a
div
container with animg
element inside to our slides. Afterwards we integrate onClick functionalities to both, all the plots (akaimg
elements) and the image with classzoomImg
. If you are clicking on a plot, it will be displayed inside our container and if you click on that container, it will vanish again. Here's the code:This will result in the following presentation:
No click:
Click on first plot:
To make this work for a normal HTML document, change
to