visible and display in javascript

Discussion in 'JavaScript' started by ClickMedia, Sep 25, 2008.

Thread Status:
Not open for further replies.
  1. #1
    Can any tell me what is difference between Visibility and display in javascript ?
    Any link may helpful .....
     
    ClickMedia, Sep 25, 2008 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    sure. this belongs in the css forum, really. visbility can be visible or hidden. it just hides the element from view - imagine that you have a box - layer - div. width 50, height 50, something like that:

    foo
    <div style="width: 50px; height: 50px;">
    bar
    </div>
    foo again


    this will render on-screen as:

    foo
    bar


    foo again

    if you change the visibility of the layer to hidden, it will keep it's allotted screen space and render this:

    foo



    foo again

    if you, however, change the display to none instead, it will render as this:

    foo
    foo again

    basically, it hides it and releases the space that it takes so any elements around it that float or whatever, reclaim the gap.
    you have several modes of display also, block, inline etc etc. they all have css implications. hope this explains it somewhat
     
    dimitar christoff, Sep 25, 2008 IP
Thread Status:
Not open for further replies.