This filter works. Each time you select a category from one of the drop down menus (using art terminology as an example), the filtered results are displayed with animation. I just want to make sure there are no glaring code discrepancies or incompatibilities before I move on with the project. Or if you know a more elegant way to achieve the same, please reply. Thanks. Here’s the fiddle:
Share
Well, your
#maindivisn’t using proper HTML syntax, and, when it does, it messes up the layout.Shouldn’t you jQuery be a bit more like this though?
Demo: http://jsfiddle.net/SO_AMK/yrwVZ/
jQuery:
I added the error for appearances sake.
Your filtering is slightly redundant and could possibly mess up if you only hide the selected paintings initially. So, instead, you can just hide them all then show the correct ones.
P.S. You can use my float clearing method, instead of an empty DIV, like this: