i want (ShowMenuString and the inside button to appear just in mobile without being collapsed)
the problem ShowMenuStrip and the button inside it keeps appearing on desktop and mobile
when i set (Collapsed on load) they don’t appear on both
this is the code I have used :
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixWindow from ‘wix-window’;
import wixLocation from ‘wix-location’;
import {session} from ‘wix-storage’;
$w.onReady(function () {
//TODO: write your page related code here…
if(session.getItem(“location”) !== wixLocation.url) {
session.setItem(“location”, wixLocation.url);
wixLocation.to(wixLocation.url);
}
if (
wixWindow.formFactor === “Mobile”
) {
$w(“#ShowMenuStrip”).expand();
} else if (
wixWindow.formFactor === “Desktop”
) {
$w(“#MenuStrip”).expand();
}
});
export function MenuButton_click(event, $w) {
//Add your code for this event here:
if ($w(“#MenuStrip”).collapsed) {
$w(“#MenuStrip”).expand();
} else {
$w(“#MenuStrip”).collapse();
}
}
i also tried what mentioned in this link:
https://support.wix.com/en/article/how-to-use-wix-…
but no result
so can you help me please
Thanks in advance and sorry for any inconvenience.
Hi, this issue will be fixed. The issue is relevant only for Preview mode while editing site on desktop. So if you publish your site and check on a real mobile device, your code will work as expected. Please check and let me know if you encounter any trouble.
Thanks!
Thanks