I want to hide DIV place holder

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Darren

    #1

    I want to hide DIV place holder

    This works fine in netscape but IE won't do it. I have a div which contains
    some links and a thumbnail. What's supposed to happen is when you click the
    thumbnail the links disapear and the now invisible div is resized moving
    everything below it. In IE it only resizes as small as the size of the dive
    plus the size of the links.

    heres an example

    <div class="relatedL inks" id="posix">
    <h3>Posix (Linux,UNIX,BSD )</h3>
    <img id ="posixDropdown Button" src="downarrow. gif" width="8" height="8"
    onClick="showHi deDropDown('pos ixSection','pos ixDropdownButto n','posixSectio n
    ','8px','112px' )">
    <div id="posixSectio n">
    <a href="http://www.freshmeat.n et" target="_top">F reshmeat</a>
    <a href="http://www.redhat.com/" target="_top">R edHat Linux</a>
    <a href="http://www.debian.org/" target="_top">D ebian Linux</a>
    <a href="http://www.novell.com/linux/suse/" target="_top">S use
    Linux</a>
    <a href="http://www.slackware.c om/" target="_top">S lackware
    Linux</a>
    <a href="http://www.freebsd.org/" target="_top">F reeBSD</a>
    <a href="http://www.openbsd.org/" target="_top">O penBSD</a>
    </div>
    </div>

    the function for doiong the magic is

    function showHideDropDow n(tItem,tIcon,t Parent,tMin,tMa x)
    {
    var lItem=document. getElementById( tItem);
    var lIcon=document. getElementById( tIcon);
    var parentSection=d ocument.getElem entById(tParent );
    if (lIcon.src.sear ch("uparrow.gif ")!=-1)
    {
    lIcon.src="down arrow.gif";
    lItem.style.vis ibility="hidden ";
    parentSection.s tyle.height=tMi n;

    }
    else
    {
    lIcon.src="upar row.gif";
    lItem.style.vis ibility="visibl e";
    parentSection.s tyle.height=tMa x;
    }

    }

    It works terrific in netscape but it looks tacky in IE. Any ideas how to
    make it work properly?

    Thanks



  • Martin Kurz

    #2
    Re: I want to hide DIV place holder

    Hi Darren,
    [color=blue]
    > function showHideDropDow n(tItem,tIcon,t Parent,tMin,tMa x)
    > {
    > var lItem=document. getElementById( tItem);
    > var lIcon=document. getElementById( tIcon);
    > var parentSection=d ocument.getElem entById(tParent );
    > if (lIcon.src.sear ch("uparrow.gif ")!=-1)
    > {
    > lIcon.src="down arrow.gif";
    > lItem.style.vis ibility="hidden ";
    > parentSection.s tyle.height=tMi n;
    >
    > }
    > else
    > {
    > lIcon.src="upar row.gif";
    > lItem.style.vis ibility="visibl e";
    > parentSection.s tyle.height=tMa x;
    > }
    >
    > }
    >
    > It works terrific in netscape but it looks tacky in IE. Any ideas how to
    > make it work properly?[/color]

    Instead of setting CSS-Visibilty to visible/hidden set Display to block/none:

    if (lIcon.src.sear ch("uparrow.gif ")!=-1)
    {
    lIcon.src="down arrow.gif";
    lItem.style.dis play="none";
    parentSection.s tyle.height=tMi n;

    }
    else
    {
    lIcon.src="upar row.gif";
    lItem.style.dis play="block";
    parentSection.s tyle.height=tMa x;
    }

    Greetings,

    Martin

    Comment

    • Darren

      #3
      Re: I want to hide DIV place holder


      "Martin Kurz" <info@martinkur z.in-berlin.de> wrote in message
      news:1124101236 .181639@elch.in-berlin.de...[color=blue]
      > Hi Darren,[/color]

      Spot on Marten. That did the trick. Thanks so much.


      Comment

      Working...