I currently have an image gallery with a filtering capability which is in Wordpress. Each image in the gallery possesses a data-id (eg data-id="id-148").
I'd like to ask help on how to code on jQuery. I hope to have a multiple set of data-ids to be removed (or hidden) when the website loads then when I click on certain buttons (a href) with specific Class, these data-ids will then be showed.
Let's say onLoad the images with data ids: 148, 149, 150 will be hidden then onClick of a button with a particular class class="Apples" then 148 will show. If I click button with class="Orange" then data-id 149 will show. When I click class="All" the data-idsmentioned above will be hidden again.
The image is located in a list-item as such:
<li class="one-third column" data-id="id-148" data-type="Apples">
Hope to have some help. Thank you so much.
Hope you get some enlightenment from this:
References:
Find an element with a specific data attribute jQuery