title: Scroll to the bottom of the navbar page
body: <p>Let say I have below <code>Shiny-app</code> -</p>
  
  <pre><code>library(markdown)
  
  ui =
  shinyUI(
    navbarPage(id = "Navbar", "Navbar",
                  tabPanel(tabName = "Tab1", "Tab1", 
                            div(style = "height: 2000px; width: 1500px; margin: 0; padding: 0; overflow-y: scroll;",
                                                  div(style = "height: 3000px; width: 50%; margin: 0; padding: 0;",
                                                      HTML("A")))),
                  tabPanel(tabName = "Tab2", "Tab2",
                            div(style = "height: 2000px; width: 1100px; margin: 0; padding: 0; overflow-y: scroll;",
                                                  div(style = "height: 3000px; width: 50%; margin: 0; padding: 0;",
                                                      HTML("B"))))
                )
  )
  
  server =
  function(input, output, session) {
  
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Now I want when user click the <code>2nd tab</code> for the first time, <code>app</code> should automatically scroll down to <code>bottom</code> of both the container page and <code>div</code>. I am thinking to have some sort of smooth scrolling.</p>
  
  <p>Is there any way to achieve this?</p>
  
  <p>Any pointer will be highly appreciated.</p>
  
  <p>Based on the suggestion from @dcruvolo on adding data-name, I have modified the <code>app</code> -</p>
  
  <pre><code>library(shiny)
  ui &lt;- tagList(
      navbarPage(
          id = "Navbar", "Navbar",
          tabPanel(
              tabName = "Tab1", "Tab1",
              div(
                  style = "height: 2000px; width: 1500px; margin: 0; padding: 0; overflow-y: scroll;",
                  div(
                      style = "height: 3000px; width: 50%; margin: 0; padding: 0;",
                      HTML("A")
                  )
              )
          ),
          tabPanel(
              tabName = "Tab2", `data-name` = "Tab2", "Tab2",
              div(
                  style = "height: 2000px; width: 1100px; margin: 0; padding: 0; overflow-y: scroll;",
                  div(
                      style = "height: 3000px; width: 50%; margin: 0; padding: 0;",
                      HTML("B")
                  )
              )
          )
      ),
      tags$script(
          "
          // select desired tab link
          $('a[data-name=\"Tab2\"]').bind('click', function(event) {
  
              // scroll to bottom of page
              $('html, body').animate({
                  scrollTop: document.body.scrollHeight
              }, 500);
  
              // remove
              $(this).unbind('click');
          })
          "
      )
  )
  
  server &lt;- function(input, output, session) {
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Unfortunately, scrolling effect is not visible.</p>