SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Enthusiast Trilliann's Avatar
    Join Date
    Apr 2002
    Location
    California
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    show/hide layers in NS6 without leaving empty space

    Hello all,

    I have two layers, and depending on a radio button one of the layers will be visible and the other will be hidden.
    I can make it work on MSIE and NS by using style.visibility, but my problem is: the hidden layer still takes space on the screen.
    (I wanted it to be just like style.display, where the hidden layer doesn't take screen space, but it only works on IE)
    Does anybody have a solution for that?

    TIA

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    style.display doesn't work?

    It should, well it does. Can you show us some code. style.visibility simply hides the layer leaving behind physical space while style.display changes the display.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Enthusiast Trilliann's Avatar
    Join Date
    Apr 2002
    Location
    California
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    style.display doesn't work on NS6...
    Works great on IE

    What can I do with Netscape?

  4. #4
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Trilliann
    style.display doesn't work on NS6...
    Works great on IE

    What can I do with Netscape?
    you will have to show me your code...cause I am 100% sure I have gotten style.display working...just as a test I ran this through netscape (just in case I was wrong)

    Code:
    <body>
    <a href="javascript:void(0)" 
    onmouseover="document.getElementById('bob').style.display=''" 
    onmouseout="document.getElementById('bob').style.display='none'">link</a>
    <div id="bob" style="display:none">
    testing
    </div>
    <div id="bob1" style="display:''">
    testin2
    </div>
    </body>
    This code works in Netscape and mozilla and IE. It of course doesn't work in opera but really that isn't surprising.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  5. #5
    SitePoint Enthusiast Trilliann's Avatar
    Join Date
    Apr 2002
    Location
    California
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright!!!

    I wasn't using getElementById...

    Thanks thanks!
    Last edited by Trilliann; Apr 26, 2002 at 21:45.

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <pre>

    ie

    <body>
    <
    a href="javascript:void(0)" 
    onmouseover="document.all['bob'].style.display='block'" 
    onmouseout="document.all['bob'].style.display='none'">link</a>
    <
    div id="bob" style="display:none">
    testing
    </div>
    <
    div id="bob1" style="display:''">
    testin2
    </div>
    </
    body>

    ns //  i think its layer if i remember right

    <body>
    <
    a href="javascript:void(0)" 
    onmouseover="document.layer['bob2'].style.display='block'" 
    onmouseout="document.layer['bob2'].style.display='none'">link</a>
    <
    div id="bob2" style="display:none">
    testing
    </div>
    <
    div id="bob1" style="display:''">
    testin2
    </div>
    </
    body>

    </
    pre

  7. #7
    SitePoint Enthusiast Trilliann's Avatar
    Join Date
    Apr 2002
    Location
    California
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maelstrom - show you my what?! Ahhh...
    The code was too big to paste here. But it was something like
    function showHide(indicator,division)
    {
    if (indicator)
    {
    if (indicator.status)
    {
    indicator.status = false;
    division.style.display ='none';
    }
    else
    {
    indicator.status = true;
    division.style.display ='';
    }
    }
    }

    THAT would only work on IE. I guess have to use getElementById, I'll try that.

    Thanks again

  8. #8
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha my incomplete sentences again. ...

    You code looks fine I would say it has something to do with the way you are referencing the dom. Without seeing more code I can't really say.

    I actually don't write my code like that but I was rushed and wanted to give a working example Glad it helped.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.


Bookmarks

Posting Permissions

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