I use List & Grid.
I want to hide elements in mobile display.
I can do that, but when another page edit the elements appear automatically.
Can I hide List & Grid elements in mobile?
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
Hi,
import wixWindow from 'wix-window'; $w.onReady(() => { let formFactor = wixWindow.formFactor; if (formFactor === 'Mobile') { $w('#yourElement').hide(); } });
Roi.
After all It will not move.
I have to delete the button use hide element button.
But when another place edit, the button I want to hide appear again.
import wixWindow from 'wix-window';
$w.onReady( function () {
if(wixWindow.formFactor === "Mobile" &&
wixWindow.rendering.renderCycle === 1) {
$w("#button5").hide();
$w("#button7").hide();
}
} );
Thanks Yisrael :)
I try it now
See this: Appendix: Rendering Optimization
I would suggest testing it without the check for renderCycle and see how it works. You can always put the renderCycle test back in.
Hi Yisrael,
Does renderCycle can work in Mobile device now???
It's because I have used renderCycle in my page code $w.onReady( ) but mobile device cannot do the function inside my renderCycle.
Mobile not mobile
Thank you Roi
I wrote your code, but its not work,,,,
so I wrote like this page https://support.wix.com/en/article/how-to-use-wix-code-to-display-elements-in-mobile-only
but It's not work,,,
This is the code I wrote.
Please tell me where is wrong.
*I selected the Hidden on load checkbox in the Properties panel.
*button5 & button7 is differ List & Grid items
import wixWindow from 'wix-window';
$w.onReady( function () {
if(wixWindow.formFactor === "mobile" &&
wixWindow.rendering.renderCycle === 1) {
$w("#button5").hide();
$w("#button7").hide();
}
} );
Yisrael Thanks your reply.
I saw the wix-widow.formFactor, but I can't understand how to write.
So Please tell me sample code or something.
Use wix-window.formFactor to determine whether you are running on desktop or mobile. You can then hide() or show() depending on the result.