tags:

views:

251

answers:

2

Hi,

I am trying to achieve like this.

I have total 4 div. each div have check box.

So it is like this

1  2  3  4

What I want to do is, when 2 , 3, 4 div checkbox are selectable. But Once div is checked, another 2 div will be hide.

Let's say, if i will choose 3, 2 and 4 will be hide. Till this stage, I am able to do. But the problem i got is about

After 2 and 4 is hide. Layout became like this

1    3

2 and 4 div are still there, so there's still spacing between them.

What I want to get is just

1 3

How can i achieve this ?

A: 

Hi:

what if you do something like this(to remove the innerHTML inside the divs):

$("div#1, div#3").html("");

Will this work???

Michael Mao
thanks, i will try it.
spotlightsnap
+1  A: 

From what I can understand, you don't seem to be hiding the divs but the contents of the div. In order to make them completely invisible you need to use the hide() method.

$("#div2, #div4").hide();

this will take the divs out of the page flow completely

Darko Z
thanks much, i will try now and will get back
spotlightsnap