Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
function switch01(){ $("#contact").hide(); $("#about").hide(); $("#mail").hide(); };
这可行,但我希望所有三行都写在一行中。 我尝试了+和,- 没有结果。 事实上,我有五个 div 要隐藏。
+
,
看到这个:http ://api.jquery.com/multiple-selector/
$("#contact,#about,#mail").hide();
应该管用
你可以像这样用逗号分隔你的答案
$("#contact, #about, #mail").hide();
例子在这里
http://jsfiddle.net/c4swG/
我通常会为此使用一个类,例如隐藏
<div id="contact" class="hidden">contact</div> <div id="about" class="hidden">about</div> <div id="mail" class="hidden">mail</div> $(".hidden").hide();
http://jsfiddle.net/fBucw/
用什么宏可以用更短的东西替换“模板...”样板?即:而不是这些:
template <typename NodeDataT, typename ArcDataT> /*constructor*/ GraphDirected:: GraphDirected() { } template <typename Nod
1 android - 根据屏幕尺寸在android中强制纵向或横向模式
1 google-sheets - 搜索值并在下一列中查找值
1 cookies - 如何使用 Phantomjs 的 cookie API?
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641