I hide a repeater on desktop and show it on mobile site. On mobile site looks fine. I have problem on desktop. Here is a big empty space. I tried X+CMD and then V+CMD and it does not work for me.
@pocaktomas When it comes to coding console logging information is very very very basic, it logs information in the console. You read the console to see what information is logged.
@pocaktomas Have you got your import for wix window at the top of your code?
Also, can you not put the all the separate elements into a box or container for example so that they are all grouped and attached to the one element, so that you only have to add that one container etc to your code?
If you are only wanting it to show on mobile only, then just write it for mobile only, don’t need to bother with the desktop code.
import wixWindow from 'wix-window';
$w.onReady(function () {
if(wixWindow.formFactor === "Mobile"){
$w("#repeater").show();
$w("#pagination1").show();
$w("#naslovnavrstica").show();
$w("#text101").show();
$w("#text102").show();
$w("#text103").show();
}
});
//Make all desktop items set to hidden on load on desktop editor.
Or for just the one container…
import wixWindow from 'wix-window';
$w.onReady(function () {
if(wixWindow.formFactor === "Mobile"){
$w("#containerbox").show();
}
});
//Make all desktop items set to hidden on load on desktop editor.
Show On Mobile Only
This works perfectly, however it only works on published site.
IT DOES NOT SHOW CORRECTLY ON PREVIEW.
Testing
If you want to test how your code works on mobile devices, you’ll need to publish your site and view the published version on a mobile device or in a mobile device emulator.