Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #401825

    Hi
    On this page:http://www.cjff.dk/forside-2015-2/
    I am trying to swap the #mobile section with #screen on devices,
    and vice versa. It’s not working on my end. I am using this:

    @media only screen and (min-width: 768px) {
    .postid-2731 #mobile {
    display: none!important;
    }
    .postid-2731 #screen {
    display: block!important; }
    }
    @media only screen and (max-width: 768px) {
    .postid-2731 #mobile {
    display: block!important;
    }
    .postid-2731 #screen {
    display: none!important;
    }}

    ?? thanks for taking a look.
    N

    #402148

    Hey N

    Please use the code as following

    @media only screen and (min-width: 769px) {
    .postid-2731 #mobile {
    display: none!important;
    }
    .postid-2731 #screen {
    display: block!important; }
    }
    @media only screen and (max-width: 768px) {
    .postid-2731 #mobile {
    display: block!important;
    }
    .postid-2731 #screen {
    display: none!important;
    }}
    

    Cheers!
    Yigit

    #402180

    Isn’t that the same code? I can’t see what the issue is… :(
    also I am getting the same results:
    http://www.cjff.dk/forside-2015-2/
    where both “programs” are showing

    • This reply was modified 9 years, 1 month ago by Munford.
    #402184

    Hey!

    I changed “min-width: 768px” to “min-width: 769px”. Please try and let us know if it does not help

    Regards,
    Yigit

    #402189

    duh.
    I need more sleep.
    but I am still not seeing it working correctly. cleared the cache

    thanks

    • This reply was modified 9 years, 1 month ago by Munford.
    #402197

    Hey!

    I did not check the page throughly thinking changing width would help but actually it is not working because it is a page and not a post. So selectors should be changed as following

    @media only screen and (min-width: 769px) {
    .page-id-2731 #mobile {
    display: none!important;
    }
    .page-id-2731 #screen {
    display: block!important; }
    }
    @media only screen and (max-width: 768px) {
    .page-id-2731 #mobile {
    display: block!important;
    }
    .page-id-2731 #screen {
    display: none!important;
    }}

    Cheers!
    Yigit

    • This reply was modified 9 years, 1 month ago by Yigit.
    #402212

    ah very very good thanks.
    That should do it.
    ;)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘swap sections on mobile not working’ is closed to new replies.