I am new to coding, and have created some basic code to show and hide text when hovering over a button. The code works fine when i test the url, but if I click the button and go back to the home page and then return to that same page, the button disappears. The text that should be hidden has also stayed? Im not sure what I'm doing wrong here, so if anyone can help that would be awesome!
Here is the code and I have attached a video example:
export function allproductsButtonnew_mouseIn(event) {
$w('#allproductTEXT').show();
}
export function allproductsButtonnew_mouseOut(event) {
$w('#allproductTEXT').hide();
}
The site's memory remembers the state of the elements when you leave the page, and you haven't directed it to revert to the previous state under all potential conditions, so there's a chance it won't. If the mouseOut() doesn't complete, or if during the page transition/load you accidentally trigger the event, it can glitch. The quickest solution is to show the button, and hide the text every time the page loads:
$w.onReady(function() { $w('#allproductsButtonnew').show(); $w('#allproductTEXT').hide(); });