[SOLVED] Hide() function does not work

Hello all! As mentioned in the title, the hide() function does not seem to hide elements in my website homepage. If I preview the website the function seems to hide the elements properly like so:


However on the actual website the elements are not hidden properly:


You can view the page directly via this link (just scroll down to the Coaching Specialties section). The code I used to hide the elements is as follows:

$w.onReady(function () {
    $w("#group1").hide();
    $w("#text108").hide();
    $w("#button24").hide();
    $w("#text109").hide();
    $w("#button25").hide();
    $w("#text111").hide();
    $w("#button27").hide();
    $w("#text114").hide();
    $w("#button30").hide();
    $w("#text116").hide();
    $w("#button32").hide();
});

export function button21_click(event) {
    $w("#button21").hide();
    $w("#image5").hide();
    $w("#button24").show();
    $w("#text108").show();
}

export function button24_click(event) {
    $w("#button24").hide();
    $w("#text108").hide();
    $w("#button21").show();
    $w("#image5").show();
}

export function button26_click(event) {
    $w("#button26").hide();
    $w("#image6").hide();
    $w("#button25").show();
    $w("#text109").show();
}

export function button25_click(event) {
    $w("#button25").hide();
    $w("#text109").hide();
    $w("#button26").show();
    $w("#image6").show(); 
}

export function button28_click(event) {
    $w("#button28").hide();
    $w("#image7").hide();
    $w("#button27").show();
    $w("#text111").show();
}

export function button27_click(event) {
    $w("#button27").hide();
    $w("#text111").hide();
    $w("#button28").show();
    $w("#image7").show();
}

export function button29_click(event) {
    $w("#button29").hide();
    $w("#image8").hide();
    $w("#button30").show();
    $w("#text114").show(); 
}

export function button30_click(event) {
    $w("#button30").hide();
    $w("#text114").hide();
    $w("#button29").show();
    $w("#image8").show(); 
}

export function button31_click(event) {
    $w("#button31").hide();
    $w("#image9").hide();
    $w("#button32").show();
    $w("#text116").show();  
}

export function button32_click(event) {
    $w("#button32").hide();
    $w("#text116").hide();
    $w("#button31").show();
    $w("#image9").show();  
}

I’m wondering if maybe this might be an issue on Wix’s end? Because I haven’t had this issue previously and everything used to work fine until now. Thank you so much for your help! (:

Look at the console. You got some errors there.
It looks like you were trying to hide an element that does not exist.
Make sure the element id is correctly spelled and that all the elements are there.

P.S. probably $w(“#group1”) doesn’t exist.

@jonatandor35 Thank you for the tip! I do have group1 in the homepage, but I just moved it to Site Code rather than the Home Page Code and now the hide() functions are all working properly. Thank you again for the help!!! :slight_smile:

@joanneh You’re welcome :slight_smile:

@joanneh , by the way, you still have another error on this page - you’re trying to pull an image that does no longer exist. Look at your console.

@jonatandor35 Thanks for letting me know, I will look into where the image is coming from. I can’t seem to locate where it is or what it was even supposed to display on my site as of right now. Useful to know though, so thanks again! :smiley:

Hi how did you fix your issue?