Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Banned
    Join Date
    Oct 2010
    Posts
    115
    Thanks
    30
    Thanked 0 Times in 0 Posts

    auto object positioning

    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.

  • #2
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    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.
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P

  • #3
    Banned
    Join Date
    Oct 2010
    Posts
    115
    Thanks
    30
    Thanked 0 Times in 0 Posts
    whats the difference?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Why did you repeat this question????

    (And why did DJCMBear repeat his answer?)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Old Pedant View Post
    Why did you repeat this question????
    WWhhaatt ddooeess dduupplleexx mmeeaann??


    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.

  • #6
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    Please only stick to one thread. Discuss on here or on the other thread not both.
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •