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

219
Visualizações
How to disable a DIV when accessing site through PWA

I have developed a site and want to use it as PWA (Progressive Web App) as well.

But I want to hide specific elements in the PWA. I have tried the CSS approach:

@media all and (display-mode: standalone) {
.noShowApp {
    display: none;
}

}

And the JS approach:

function isRunningStandalone() {
    return (window.matchMedia('(display-mode: standalone)').matches);
}

if (isRunningStandalone()) {
    alert('hi');
    hide(document.getElementById('features'));
}

I get my 'alert' in the App, but the section I want to hide, is not hidden....

This is the section I want to hide:

<section class="py-5 border-bottom noShowApp" id="features">

Can someone point me in the right direction on how to get any of these methods (CSS or JS) to work. I prefer the CSS approach, but if that's not possible, JS will do just fine.

about 4 years ago · Juan Pablo Isaza
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