yonicd / slickR

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

How change style settings in multiple slider ? #73

Open yoelii opened 12 months ago

yoelii commented 12 months ago

Hi,

I want to use several slider with slickR in a shiny app. I use slideId in order to distinct my slider. I want to change the background color and not use the same between the slider.

At the begin, I used css file and ".slide-slide" part to change the color :

.slick-slide {
     text-align: center;
     width: 250px;
     height: 260px;
     background: #FAF2F4;
     margin-top: 20px;
 }

But I can't add "css class name" in slickR function in order to add style option.

bacteria <- slick_list(
  tags$button(class = "button_bacteria",
    id = "xxxxxx",
    tags$img(
      class  = "icon_menu",
      src = "icons/xxxx.svg",
      height = "60px"
    ),
    p("XXXXXXXX"),
  ),
  tags$button(class = "button_bacteria",
    id = "xxxxxx",
    tags$img(
      class  = "icon_menu",
      src = "icons/xxxx.svg",
      height = "60px"
    ),
    p("XXXXXXXX"),
  ),
.....

)

population <- slick_list(
  tags$button(class = "button_pop",
    id = "xxxxxx",
    tags$img(
      class  = "icon_menu",
      src = "icons/xxxx.svg",
      height = "60px"
    ),
    p("XXXXXXXX"),
  ),
  tags$button(class = "button_pop",
    id = "xxxxxx",
    tags$img(
      class  = "icon_menu",
      src = "icons/xxxx.svg",
      height = "60px"
    ),
    p("XXXXXXXX"),
  ),
.....

)

.....

 slickR(slideId = "bacteria", obj = bacteria, height = 60) + opts,

slickR(slideId = "population", obj = bacteria, height = 60) + opts,
.....

How can I change some settings ?

Thanks