We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to detect mobile without the library ?

How Do I?

Taj's avatar
Taj
1 posts
4 years ago
Taj's avatar Taj

{if mobile} <!– add html code for mobile –>

Mobile

{/if}

if ($(window).width() <= 480) { set the expression engine variable }

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
4 years ago
Brian Litzinger's avatar Brian Litzinger

Is this still a thing anymore? Device detection is probably not the thing to do. If you need to render different content on mobile it’s probably best to just render both versions of the content and use css media queries to show/hide content.

πŸ‘ 1
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.