Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
How to set an elements initial state to be hidden?

I use an extention that allows me to edit the css of Youtube. I need the navigation menu on the left of youtube home page to be hidden when the webpage loads and appear when the menu button is clicked.

This is how it looks now

Is there any way I can do this?

The extention can use Javascript too.

HTML code when the bar is open:

<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y;" position="left" swipe-open="" opened="" persistent="">

HTML code when the bar is closed:

<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y;" position="left" swipe-open="" persistent="">

HTML code of the button

<yt-icon-button id="guide-button" toggleable="true" class="style-scope ytd-masthead"><!--css-build:shady--><button id="button" class="style-scope yt-icon-button" aria-label="Guide" aria-pressed="true">
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Hope this helps?

document.getElementById("guide-button").onclick = function() {  
  myFunction() 
}; 
function myFunction() {
  var x = document.getElementById("guide");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y; display:none;" position="left" swipe-open="" opened="" persistent="">

<yt-icon-button id="guide-button" toggleable="true" class="style-scope ytd-masthead"><!--css-build:shady--><button id="button" class="style-scope yt-icon-button" aria-label="Guide" aria-pressed="true">

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda