Hi, the hide(), show() functions are not working in my site. It has been working a week ago. Not only in Corvid it’s not working, in the masterpage.js it’s not working if I select hide as default. My page is highly relied on hide(), show() to distinguish a tablet & computer browser page.
And I used that function for the menu and it’s not working right now
This is the code I’m using :
import wixWindow from 'wix-window';//at top of the code page
$w.onReady(() => {
$w("#tabletMenu").hide();
wixWindow.getBoundingRect()
.then(winInfo => {
let winHeight = winInfo.window.height;
let winWidth = winInfo.window.width;
if (winWidth < 1024){
$w("#largeScreenMenu").hide();
$w("#tabletMenu").show();
} else {
$w("#tabletMenu").hide();
$w("#largeScreenMenu").show();
}
} );
});
$w.onReady(function () {
// Write your code here
});
import wixWindow from 'wix-window';//at top of the code page
$w.onReady(function() => {
$w("#tabletMenu").hide();
wixWindow.getBoundingRect()
.then(winInfo => {
let winHeight = winInfo.window.height;
let winWidth = winInfo.window.width;
if (winWidth < 1024){
$w("#largeScreenMenu").collapse();
$w("#tabletMenu").expand();
} else {
$w("#tabletMenu").collapse();
$w("#largeScreenMenu").expand();
}
} );
});
i olmost always using collapse, expand since it moves my elements to not have any spacings.
you have another element on the same place but it still might work.
or try using async await.
import wixWindow from 'wix-window';//at top of the code page
$w.onReady(async function() => {
$w("#tabletMenu").hide();
await wixWindow.getBoundingRect()
.then(winInfo => {
let winHeight = winInfo.window.height;
let winWidth = winInfo.window.width;
if (winWidth < 1024){
$w("#largeScreenMenu").hide();
$w("#tabletMenu").show();
} else {
$w("#tabletMenu").hide();
$w("#largeScreenMenu").show();
}
} );
});
I observe similar issue. I have strips which are hidden & collapsed by default. Today I see a white gap at place where the hidden & collapsed strips are located. Something related to hide/collapse functionality was broken…
I have solved partially the problem by using collapse and expand. But hide/show seems still not working even though I’m setting them in a non-coding way.
as Aleksander just said, seems there whas an issue with show/hide on the Wix side, so if you want you can change it back to show/hide instead of expand/collapse