1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Criteria for notices - using a mobile device/narrow screen width

Discussion in 'Styling and Customization Questions' started by Stuart Wright, Nov 14, 2013.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    Is this something which would be easy to add?
    I want to only display a notification to people not using a mobile device. Or with a narrow width. 800 pixels maybe.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Stuart Wright

    Stuart Wright Well-Known Member

    What class Brogan? Whoosh over my head! :(
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    The notice should have a CSS class applied to it.
    You can use a media query to do display:none for that class below a certain browser width.
    For example:
    Code:
    <xen:if is="@enableResponsive">
        @media (max-width:800px) {
            .noticeClass {
            display: none;
            }
        }
    </xen:if>
    So if the style is responsive and the browser width is 800px or less, the .noticeClass element won't be displayed.

    Or you can use @maxResponsiveWideWidth instead of 800px.
    Or you can add one of the predefined classes (at the bottom of the guide) to the HTML.
     
    dwdmadmac and HenrikHansen like this.

Share This Page