Comments (3)
i've been wondering how to get the arrows to show up. thanks for that (now it is part of the base css theme). i had my css set to 80% for the text align width.
I think it was to control the overlapping of the images, but padding takes care of that now.
now the padding is part of the margins that you see only when moving between images.
slickR::slickR(
obj = imgs,
height=400,
width=600,
slideId = 'ex1',
slickOpts = list(
dots = TRUE,
arrows = TRUE,
slidesToShow = 1,
slidesToScroll = 1
)
)
from slickr.
i added a padding parameter to control white space between images within the carousel.
imgs <- c('https://static.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg',
'http://wallpoop.com/wp-content/uploads/2012/07/persian-kittens-.jpg',
'http://i0.kym-cdn.com/photos/images/original/000/068/576/kittycat.jpg')
slickR::slickR(
obj = imgs,
slideId = 'ex1',
padding='1%',
slickOpts = list(
slidesToShow=1,
centerMode = TRUE,
dots = TRUE
), height=400, width='100%'
)
you also have the slickjs option of setting variableWidth=TRUE
which will allow each image to be a different with, but i find that hard to control.
from slickr.
The padding
param is helpful - thanks for adding it so quickly!
Unfortunately it didn't get me the result I was looking for. I didn't specify very clearly, so that's my bad. When I run your reprex I see the three images separated by white bars, like this:
slickR::slickR(
obj = imgs,
slideId = 'ex1',
padding='1%',
slickOpts = list(
slidesToShow=1,
centerMode = TRUE,
dots = TRUE
), height=400, width=600
)
What I was hoping to achieve was a carousel that only shows the focus image. After some tinkering I managed to do it by attaching a style tag to the htmlwidget like so:
slickR::slickR(
obj = imgs,
height=400,
width=600,
slideId = 'ex1',
padding=0,
slickOpts = list(
dots = TRUE,
arrows = TRUE,
slidesToShow = 1,
slidesToScroll = 1
)
) %>% htmlwidgets::prependContent(htmltools::tags$style(".slick-list {text-align: center; width: 100% !important;}
.slick-prev:before, .slick-next:before {opacity: .25; color: #404040}"))
I'll be the first to admit this is a pretty inelegant solution. I think I'm basically trying to recreate the Single Item mode shown here.
If you have a cleaner way of doing this I'd love to hear it.
Thanks for the package!
from slickr.
Related Issues (20)
- slickR not working with markdown when tabs are used? HOT 25
- slickROutput(height = '50px') not respected HOT 3
- Error thrown by HTMLTools HOT 2
- slickR no longer available on CRAN HOT 2
- using slickR for mobile HOT 2
- slickR shiny vignette broken HOT 12
- shiny: Carousel "jumps" when re-rendered with numeric height HOT 3
- slickr_output_current$.center isn't providing data on shiny app startup HOT 3
- Synch 3 Carousels and Change Color of Text HOT 3
- Move previous next buttons HOT 4
- target = "_self" HOT 1
- Browser side linking to other chart HOT 4
- Replace a slide? HOT 1
- Shiny: carousel collapses / folds after clicking on different tab and returning to carousel page HOT 1
- SlickR always insert image into html
- Problem with slickR + shiny, when the xmlSVG-file becomes to large. HOT 2
- Change figure size according to browser window size
- SlickR and Shiny, duplicated carousels HOT 7
- how to continue the carousel after click the arrow? HOT 3
- Error in file.info(x, extra_cols = FALSE) : file name conversion problem -- name too long?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slickr.