Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 1.2k Views 1 Watching
  • 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
    DMBD
    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
      DMBD
      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
        RichardR
        Richard
        Global Moderator
        wrote on last edited by Richard
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • RichardR
          RichardR
          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
            DMBD
            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
              RichardR
              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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Online Users
              R
              robertobarbes
              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