2

Right now I am trying to make an modalbox for self, just to play arround, nothing serious because I am still newbie.

I know that there is possibility to do this:

$('#elementOne, #elementTwo, #elementThree').remove();

But is there a possibility to add two variables because I can't seem to get it working. I tried like this:

setTimeout(function() {
   $('$miniBox_wrap, $miniBox_overlay').remove();
}, 1000);

Also like this:

setTimeout(function() {
   $($miniBox_wrap, $miniBox_overlay).remove();
}, 1000);

Maybe I've done something wrong or it's not possible?

4

1 回答 1

5

Assuming your variables are jQuery objects, use jQuery's add method:

$miniBox_wrap.add( $miniBox_overlay ).remove();
于 2012-11-18T18:26:41.240 回答