Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202041

Auto-size Height in R iframe

$
0
0

I'm trying to auto-size the Height on an iframe in R. Here is an example where it's very thin:

header <- dashboardHeader(title = "Tools", titleWidth = 225)

sidebar <- dashboardSidebar(width = 225,
                            sidebarMenu(id="mySidebarMenu",
                                        menuItem(text = "Welcome", tabName = "Tools", icon = icon("apple"))
                                        )
)

body <- dashboardBody(class="text-center",
                      tabItems(
                        tabItem("Tools", class = "text-center",
                                tags$iframe(src = "https://www.macrumors.com", width = "100%", scrolling = 'no')
                        )
                      )
)

ui <- dashboardPage(header, sidebar, body, skin = 'blue')

server <- function(input, output){}

shinyApp(ui, server)

I've purposely set scrolling = 'no' because I don't want to use the URL scrolling. I want the scrolling to happen on the R server. There is no height = "100%" setting, but I had a friend send me this who said this should auto size the iframe, but I haven't a clue on how to incorporate it into my R code:

<iframe style="width: 1px; min-width: 100%;" frameborder="0" scrolling="no" src="source goes here"></iframe>
            <script>iFrameResize({autoResize:true, log:true, checkOrigin:false})</script>

Javascript file: https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.5.16/iframeResizer.contentWindow.min.js

github link: https://github.com/davidjbradshaw/iframe-resizer

Any help or directions would be apprectiated. Thanks!


Viewing all articles
Browse latest Browse all 202041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>