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

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.
 
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.
 
Top Bottom