Please ensure Javascript is enabled for purposes of website accessibility
 

Wix Websites: Hide elements on desktop, show on mobile


First, Make sure your Developer Tools are checked On (under Tools > Developer Tools > Check on: Properties Panel and Hidden Elements). See screenshot:

Wix Code Developer Tools

Then, select the item you want to hide on desktop and show on mobile. Check on "Hidden on load":

To hide items on Desktop, but then show them on mobile, insert this code into the Page Code panel (expand the Page Code at the bottom of your screen):

Here is the code – just swap out "your_second_element's_ID" with the name of your element or group.

import wixWindow from 'wix-window';

$w.onReady(function () {

if(wixWindow.formFactor === "Mobile"){

$w("#your_first_element's_ID").show();

$w("#your_second_element's_ID").show();

}

});

You can also see more detailed instructions on Wix's support forum:

https://support.wix.com/en/article/how-to-use-wix-code-to-display-elements-in-mobile-only