请看这里:http://jsfiddle.net/mAMY2/1/
如您所见,除了“显示更多”功能外,还有一个过滤器功能。我想改变“显示更多”功能的方式,以避免与过滤功能发生冲突。例如,也许有 .show() 和 .hide() 的替代方法?
冲突总结:
The "Show More" function and "Filter" function both work by manipulating the display value. If, for example, only three out of nine boxes are showing and you choose to filter a specific category, more than three boxes could potentially be displayed. Similarly, if you choose to only > display a specific category, but then wish to show more, the other category will also be ?> displayed.
谢谢
最佳答案
您可以使用 .addClass
和 .removeClass
,然后使用 css 控制可见性。
关于javascript - 使用 .show() 和 .hide() 具有两个不同的功能,而不会相互冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12840718/