...

View Full Version : auto object positioning



maxhudson
12-22-2010, 05:47 AM
I have x number of groups

Each group has 8 objects

For each group there is a button that makes it visible or invisible.

At the moment, this leaves white space in the places where a group is invisible.

So, say i have 5 groups;

If all of the groups were visible it would look like this

group 1
group 2
group 3
group 4
group 5

Now say groups 1, 2, and 5 are visible and the others are not. it would look like this

group 1
group 2


group 5

-------*******instead of having this white space where 3 and 4 used to be, i want 5 to appear in the position of 3.

Thanks.

DJCMBear
12-22-2010, 06:12 AM
Use display not visibility, let's say "obj" is the obtect you would say obj.style.display = "none"; to hide it and obj.style.display = ""; to show it.

maxhudson
12-23-2010, 06:49 AM
whats the difference?

Old Pedant
12-23-2010, 07:28 AM
Why did you repeat this question????

(And why did DJCMBear repeat his answer?)

Philip M
12-23-2010, 08:47 AM
Why did you repeat this question????


WWhhaatt ddooeess dduupplleexx mmeeaann?? :D


See w3schools:-

visibility:hidden hides an element, but it will still take up the same space as before. The element will be hidden, but still affect the layout

display:none hides an element, and it will not take up any space. The element will be hidden, and the page will be displayed as if the element is not there:

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

DJCMBear
12-23-2010, 04:53 PM
Please only stick to one thread. Discuss on here or on the other thread not both.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum