Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!