'WixWindow' Code Not Working - displaying item only on mobile

I am trying to display an item only on the mobile version. I have the element set to hidden on load for the desktop and wrote the following code for that page:

import wixWindow from ‘wix-window’;

$w.onReady( function () {
if (wixWindow.formFactor === “Mobile”) {

However, when viewing the page on mobile the element is still hidden and is not showing up. Any ideas?


Have you tried to look in the mobile editor at the hidden elements section?
If so, please share a link to your site so one of us, the WixCode team, can inspect it and provide you with a solution.