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:
is slided up, except the second div.
You can use the not selector to prevent one (or more) of them from sliding up:
$("div#personal").click(function() {
$("div :not('#idofseconddiv'").slideUp("slow");
});
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:
$("div#personal").click(function() {
$("div.someClass :not('#idofseconddiv')").slideUp("slow");
});
If you are using numbered class names on your divs, you might want to consider using the starts with attribute filter:
$("div#personal").click(function() {
$("div[class^=yourClass] :not('#idofseconddiv')").slideUp("slow");
});