向上滑动多个div
我怎样才能确保几个div向上滑动?现在我有这个功能:
$("div#personal").click(function() {
$("div.1").slideUp("slow", function () { $("div.2").slideDown("slow") } );
});
我想做的是确保所有名为:
- div.1
- div.2 EXCEPT THIS ONE
- div.3
- div.4
- div.5 的div
是向上滑动,第二个 div 除外。
How can i make sure that several divs are slided up? Right now I have this function:
$("div#personal").click(function() {
$("div.1").slideUp("slow", function () { $("div.2").slideDown("slow") } );
});
What i would want to do is to make sure that all divs that are named:
- div.1
- div.2 EXCEPT THIS ONE
- div.3
- div.4
- div.5
is slided up, except the second div.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 not 选择器来防止其中一个(或多个)向上滑动
:为这些 div 提供一个通用的 css 类是一个好主意,这样选择器就不会选择页面中的所有 div:
如果您在 div 上使用编号的类名称,您可能需要考虑使用 以属性过滤器开头:
You can use the not selector to prevent one (or more) of them from sliding up:
It would be a good idea to give those divs a common css class so the selector does not select all divs in your page:
If you are using numbered class names on your divs, you might want to consider using the starts with attribute filter: