根据查询字符串值显示/隐藏多个元素 [英] Show/Hide Multiple elements based on query string value
本文介绍了根据查询字符串值显示/隐藏多个元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我找到了有关设置查询以显示/隐藏页面上元素的文章: 基于查询字符串值显示/隐藏元素
I found this post about setting up a query to show/hide elements on a page: Show / Hide elements based on query string value
如何扩展它以显示/隐藏多个元素?
How do I extend it to show/hide multiple elements?
例如... 假设我在一个页面上有以下六个类的六个元素:.a,.b,.c,.d,.e,.f
For instance... Let's say I have six elements on a page with the following classes: .a, .b, .c, .d, .e, .f
通过一个查询,我隐藏了:.b,.d,.f 还有另一张皮革:.a,.c,.e
With one query I hide: .b,.d,.f and another hide: .a, .c, .e
两个可以处理隐藏多个元素的不同查询.
Two different queries that can handle hiding multiple elements.
有人可以帮忙吗?
推荐答案
$('.b,.d,.f').hide();
$('.a, .c, .e').hide();
这篇关于根据查询字符串值显示/隐藏多个元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文