In the members-only Tutorial Requests forum a user asked,
Question – I’m implementing a horizontal opt-in on my new site but I’d like for it to be collapsible ONLY on mobile (primarily phones – kind of like mobile menus) since it takes up a lot of room when not collapsible and viewed on mobile. How would I go about doing that?
mobble provides conditional functions and body classes to target tablets and mobiles in WordPress. In this tutorial I show how Collapsible Horizontal Opt-in form in Genesis tutorial can be tweaked so that the closing and opening of opt-in section option is visible only when the front page is viewed in mobiles.
Non-mobiles (desktops and tablets):
Create a file named say, home.js in child theme's
js directory (create, if not existing) having the following:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.