• Hey guys,

    I’m using some CSS hover/touch effect which works nicely on a desktop, but it works on a mobile only when I’m logged in as admin. As soon as I log out, any hover/touch effect is gone.

    I don’t want to share the website yet, I’m just wondering if you have any idea, why it might act differently.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Let us know what PHP changes you made to get this working (when you are logged in).

    Thread Starter Lukas K

    (@lukas-k)

    Not sure what you were asking for, but this is an example of my code:

    HTML

    <div id="layer">
      <div id="overlay"></div>
    </div>

    CSS

    #layer {
      z-index:2;
      width:150px;
      height:200px;
      background:#ffffff;
    }
    
    #overlay {
      z-index:1;
      width:150px;
      height:200px;
      background:#000000;
      opacity:0.6;
      display:none
    }
    
    #layer:hover #overlay,
    #layer:focus #overlay {
      display:block;
    }

    Thread Starter Lukas K

    (@lukas-k)

    Has anybody an idea why this code works on a mobile only when I’m logged in as admin?

    Thanks!

    I’m experiencing the same issue. :focus doesn’t respond to touch on mobile when logged out. Works like a charm when logged in. It’s a real stumper. Any resolve or insight would be greatly appreciated.

    [UPDATE]

    Turns out my issue with :focus not responding was due to my “loading” animated gif which was a background image in a 100% x 100% (otherwise) empty div container. Doh! (Why it didn’t affect the :focus state when logged in as an admin is another question I don’t have an answer to…). Removing the blanket div resolved the issue. (the loading animation was more aesthetic than functional)

    As was my case, perhaps your issue lies elsewhere as well.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CSS hover/touch on mobile (only as admin)’ is closed to new replies.