Dynamic Gallery Filter with Animation

Hi, I have created a dynamic gallery, and I have created a series of ‘category’ buttons. So a user can click the ‘all’ button to see all gallery images, or they can click the ‘river restoration’ button to only see gallery images that have a ‘river restoration’ tag in the database.

My question is: is there a way to animate this filtering? Right now when you click the buttons to filter, the images don’t have any fade or animation to them.

Thanks!
Jon

I have a slight workaround, but it’s not quite ideal…basically I have just made the button tell the gallery to hide, then filter the dataset, then show the gallery with an Effect. The 2 issues I have found are: 1.) If I add an Effect to the hide, then the show never happens for some reason, and 2.) After the show Effect finishes, the gallery seems to ‘blink’

Is there a better way to perform this and/or ways to correct these 2 issues?

Here is my code with no hide Effect (the button name is trans)

export function trans_click(event, $w) {
$w(‘#gallery1’).hide()
$w(‘#dynamicDataset’).setFilter(wixData.filter().contains(‘category’, ‘transportation’))
$w(‘#gallery1’).show(“slide”, slideInOptions);
}

Hi Jon, how did you create the “category” buttons?