Hello all, I thought this code would work, but seemingly I have it so very very wrong! Please note I am not all that familiar with code, this was copied from elsewere. Scenario: I have a page, I want to use buttons to hide and show galleries respectively (2 galleries) Each gallery draws data from a different dataset (2 datasets on the page) When the page loads #gallery1 is visible (Yay) then using the buttons i want to hide #gallery1 and show #gallery2..what am I missing from the below? Many thanks in advance. $w.onReady(function () { $w('#gallery1').show(),$w('#gallery2').hide(); }); export function button2_click(event) { $w('#gallery2').show(),$w('#gallery1').hide(); } export function button1_click(event) { $w('#gallery1').show(),$w('#gallery2').hide(); }
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Can you share what was done to resolve this
Hi Carlie, The code seems fine for most parts. The only thing you did that should not be done is adding them on 1 line seperated with a comma.
So use it like this:
export function button1_click(event){ $w('#gallery1').show(); $w('#gallery2').hide(); }
This should work :) Kind regards, Kristof.