简体   繁体   中英

Can you insert html directly into navbarPage in r shiny and how?

I'm trying to recreate a fancy-dancy navbar for my app to show the reader what they are hovering over and selecting. I'm specifically trying to recreate the navbar here:

pinkflamess.com (this is a website I made)

The trick behind that navbar selector, is that it moves depending on the whole navbar's width, using margin:0,25%,50%,75% being a child of the navbar. With r shiny, I know how to add html elements to the top of the file, but not how to insert it into navbarPage's dynamically created navbar

Is this possible? Is there a better way than trying to insert it?

Thank you for reading! I hope you have a good rest of your day

I sorta figured it out by using tags$div(), I can insert a div and any other html elements wherever I'd like. I've use this to add some nifty checkboxes to hide/show wells of different checkbox sections (they get pretty long) To get it in the navbar, I did this (simplified):

navbarPage(
           tabPanel(),
           tags$div(class="highlight"),
           tabPanel(),
           tabPanel()
           )

Hope that helps anyone else with a similar problem! From this point I just messed with the z-index to get it behind the background-less words (you can also put it last in the list, but I have other reasons why this wasn't done)

Thank you for reading and I hope you have a good rest of your day

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM