yonicd / slickR

slick carousel htmlwidget for R
https://yonicd.github.io/slickR/
Other
161 stars 14 forks source link

Move previous next buttons #59

Closed ixodid198 closed 3 years ago

ixodid198 commented 3 years ago

I can successfully move the "next" button for slickR's carousel. However, when I use the similar method to move the "previous" button it does not work. The action and the mouseover no longer work. Why is this? How can I move the "prev" button and maintain full functionality?

Here is where the fully functional moved buttons should appear: Screen Shot 2021-06-01 at 5 00 03 PM

library(shiny)
library(slickR)

# Test #########################################################################
chart_names_list <- c( "http://placehold.it/900x500/39CCCC/ffffff&text=Slide+1", 
                                                "http://placehold.it/900x500/39CCCC/ffffff&text=Slide+2",
                                                "http://placehold.it/900x500/39CCCC/ffffff&text=Slide+3")
num_slides <- 2

ui <- fluidPage(
  tags$head(
    tags$style(HTML("
    .slick-next {
      right: 163px;
      top: 20px;
    }
    .slick-prev {
      left: 670px;
      top: 20px;
    }
    .slick-slide {
      margin-top: 30px;
    }

    ")
    )
  ),

  slickROutput("slick_output")
)

server <- function(input, output, session) {
  output$slick_output <- renderSlickR({
    slickR(obj = chart_names_list, height = 300, width = "100%") +
      settings(dots = TRUE)
  })
}

shinyApp(ui, server)
yonicd commented 3 years ago

the arrows are set within the htmlwidget. i dont think in this version of the widget you will be able to move them around.

https://github.com/yonicd/slickR/blob/master/inst/htmlwidgets/lib/slickR/slickR.js#L90_L138

ixodid198 commented 3 years ago

Thanks for looking into this. But isn't it odd though that the "next" button can be moved successfully and not the "prev" button?

ismirsehregal commented 3 years ago

Related SO questions for future readers:

https://stackoverflow.com/questions/67782004/move-previous-next-buttons-in-rs-slickr-carousel/ https://stackoverflow.com/questions/67841891/make-slickr-carousel-responsive/

yonicd commented 3 years ago

thanks for the links! closing this issue here.