Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. 'display: none' not working on mobile

'display: none' not working on mobile

Scheduled Pinned Locked Moved Bug Reports
6 Posts 2 Posters 281 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DMBD Offline
    DMBD Offline
    DMB
    wrote on last edited by
    #1

    Hi there. I have an jQuery accordion where I am hiding the content at first with 'display: none;' on the class in my css.. It works fine in the desktop layout but does not work in mobile. In fact, even if i just make a simple text block, give the row a class, and then set that class to 'display: none;' it does not hide it in mobile.

    So simply put - display: none; does not work at all on mobile. I just checked and it is not working either on another site I built on mobile either. Perhaps something has gone wrong in a new iteration of lay theme? From the inspector it seems my css that sets a class to display: none is being overruled by a lay theme style sheet.

    Could you have a look please as this is a bit of a problem.

    anniebellamy.com/scholarship
    hannahcollins.net/texts

    Thankyou!
    Duncan

    1 Reply Last reply
    0
    • DMBD Offline
      DMBD Offline
      DMB
      wrote on last edited by
      #2

      Sorry i forgot to say this is happening in chrome, firefox and safari.

      1 Reply Last reply
      0
      • RichardR Offline
        RichardR Offline
        Richard
        Global Moderator
        wrote on last edited by Richard
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • RichardR Offline
          RichardR Offline
          Richard
          Global Moderator
          wrote on last edited by
          #4

          Dear @DMB

          From first look it seems your CSS:

          @media (max-width: 600px)
          .textrow1, .textrow2, .textrow3, .textrow4, .textrow5, .textrow6, .textrow7, .textrow8, .textrow9, .textrow10, .textrow11, .textrow12, .textrow13, .textrow14, .textrow15, .textrow16, .textrow17, .textrow18, .textrow19, .textrow20, .textrow21, .textrow22, .textrow23, .textrow24, .textrow25 {
              display: none;
          }
          

          'Display:none' is getting overridden by it's parent row's:

          @media (max-width: 600px)
          .lay-content .row {
              -webkit-box-sizing: border-box;
              box-sizing: border-box;
              display: block;
          }
          

          When removing/unchecking this 'display:block' your Accordions function for me.

          Hope this helps & best wishes :)

          Richard

          1 Reply Last reply
          0
          • DMBD Offline
            DMBD Offline
            DMB
            wrote on last edited by
            #5

            Hi Richard,

            This is true, this does work if I uncheck 'display:block' on the parent rows like you suggested in firefox dev tools. However, what code would i use? If I use display: none on the parent in my css then nothing shows up at all.

            Block, inline, flex etc none of those will work. Is there no way I can get my class to override the parent rows at all?

            Best,
            Duncan

            1 Reply Last reply
            0
            • RichardR Offline
              RichardR Offline
              Richard
              Global Moderator
              wrote on last edited by
              #6

              Dear Duncan @DMB

              To really 'remove' it you can use a simple line of jQuery where you target and then replace with ' ' ( nothing )

              https://stackoverflow.com/questions/9405689/how-to-remove-css-property-in-jquery/9405718

              Hope this helps you in the right direction :)

              Best Wishes
              Richard

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              I also code custom websites or custom Lay features.
              šŸ’æ Email me here: šŸ’æ
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              A
              alasdair17
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search