Hiding elements on desktop FAIL

HI,
I was trying to get elements to not show on desktop and only show on mobile.
Have no idea about code, so just followed the instructions on the corvid tutorial very strictly.
The result was that the items I defined to not load on desktop, also didn’t show on mobile.
plus - some items that I didn’t engage with at all, also stopped showing on mobile.

Waited an hour on hold to get to a wix expert by phone - they can’t touch code. was refferred here. Anyone know what is the next step?

I need to hide these items before the google crawler recognizes that I hid them underneath strips in the meanwhile…

Thanks a lot!

See: https://www.wix.com/corvid/reference/wix-window.html#formFactor

Thanks!
but this is chinese to me…
I can follow simple instructions - which I will be very greatful if you give me, because this is my final outlet for help. I had been down the chain from email support to waiting 40 mins to talk to a representative, and no help.

I’m not trying to make a whole page not show, just certain elements…

import wixWindow from 'wix-window';
$w.onReady( function() {
    if (wixWindow.formFactor !== "Mobile"){
        $w("#item1").hide();//instead of item1, use the property id of the element
    }
})

Or even better: use collapse() instead of hide()

Thank you.
Yes, used that code, it is very well explained in corvid tutorial.
but the result was that it didn’t work - or it worked but also influenced mobile site and other elements.
support says the code on their end is fine - do I need to just try again from the start on the assumption I made a mistake somwhere along the way?

What is “collapse”?

if you hide an element it still occupies its place, it just hidden, if you collapse it, it takes no place on the page.
Maybe you should post here your code (not a screenshot), so we can look for errors.

that would be great:

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

import wixWindow from ‘wix-window’;

$w.onReady( function () {
if (wixWindow.formFactor === “Mobile”){
$w(“#box103”).show();
$w(“#text281”).show();
$w(“#button70”).show();
$w(“#text283”).show();
$w(“#box104”).show();
$w(“#box105”).show();
$w(“#text284”).show();
$w(“#image21”).show();
$w(“#button71”).show();
$w(“#box101”).show();
$w(“#image20”).show();
$w(“#text282”).show();
$w(“#text285”).show();
$w(“#button72”).show();
$w(“#button73”).show();
$w(“#button74”).show();
$w(“#button75”).show();
$w(“#button76”).show();
$w(“#box102”).show();
$w(“#button77”).show();
$w(“#text286”).show();
}
});

And have you set them to be hidden by default?

hide on load? yes.

I see maybe I shouldn’t have a gap-line between the “import” and the “function” lines?

What I mean is like that.
Your code gives an order to these elements to show up if it’s mobile.
But you have no code to hide them if it’s not a mobile phone.
So either use some code to hide these elements or set it to be hidden by default on load (on the property panel).

If you hid them and it still doesn’t work, so I have no idea what the problem is.

I did set them up on proreties pannel. the tutorial is very specific about it.

this is what I followed:
https://support.wix.com/en/article/corvid-tutorial-displaying-elements-in-mobile-only

Your code is fine. So the problem is probably somewhere else.

Listen, I have been toggeled from one representative to another today, as I understand it is supposed to be a simple matter. this is my second time needing assistance and not finding it from wix (the first time I was helped by an fb group member eventually).
I don’t know where am I to turn to?
I need this done, obviously.
Can you reffer me to anything? anyone?

Someone advised me that it could be because the items are currently underneath strips (to hide them from desktop view) - could that be causing the problem?

The only thing that I can think of is that you set it to be hidden (on the property panel) in mobile mode, but not in desktop mode.
Be sure that you set it on desktop mode.

that could be - how do I tell?
I was in the desktop editor upon using corvid and going through this process - was I supposed to have gone in through the mobile editor?

Go to the desktop editor, click one of the elements, open the property panel, and check if it’s set to be hidden on load.

@jonatandor35 yes

@marvaerez If it’s not it, then you probably should come back and ask this question on Sunday when the Wix moderators are here (I think, but not sure, they are not here during the weekend). They can have an access to your editor.