title: R shinyjs show/hide not working from module
body: <p>I want to be able to switch various parts of my UI on/off using shinyjs show and hide. I need to access parts of the UI <em>outside the module from within a module</em>. Is this possible?</p>
  <p>See the attached app code. The show/hide buttons in the main server code work, but those in the module do not.</p>
  <p>Thanks for any suggestions.</p>
  <pre><code>exampleUI &lt;- function(id) {
              ns &lt;- NS(id)
              tagList(actionButton(ns(&quot;hide_id&quot;), &quot;Module - Hide divs&quot;),
                      actionButton(ns(&quot;show_id&quot;), &quot;Module - Show divs&quot;),
                      uiOutput(ns(&quot;plot_id&quot;)))
      }
      
      shinyUI(fluidPage(
              shinyjs::useShinyjs(),
                      shinyjs::hidden(tags$div(id = &quot;hidden&quot;, &quot;hidden&quot;)),
                      tags$div(id = &quot;shown&quot;, &quot;shown&quot;),
                      actionButton(&quot;hide_id&quot;, &quot;Hide divs&quot;),
                      actionButton(&quot;show_id&quot;, &quot;Show divs&quot;),
                      exampleUI(&quot;eg&quot;)))
  
      example &lt;- function(input, output, session)
      {
          ns &lt;- session$ns
          
          observeEvent(input$hide_id,
          {
              shinyjs::hide(&quot;hidden&quot;)
              shinyjs::hide(&quot;shown&quot;)
          })
          observeEvent(input$show_id,
          {
              shinyjs::show(&quot;hidden&quot;)
              shinyjs::show(&quot;shown&quot;)
          })
      }
      
      shinyServer(function(input, output) {
      
          callModule(example, &quot;eg&quot;)
          observeEvent(input$hide_id,
          {
              shinyjs::hide(&quot;hidden&quot;)
              shinyjs::hide(&quot;shown&quot;)
          })
          observeEvent(input$show_id,
          {
              shinyjs::show(&quot;hidden&quot;)
              shinyjs::show(&quot;shown&quot;)
          })
      })
  </code></pre>