how to not hide a division

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

    how to not hide a division

    In using the simple code below, how do I tell it NOT to hide a
    division when the link is clicked on if that division is already
    visible?

    would it be as simple as using a 2nd function and setting that to
    "display" rather than "none"?

    For instance, "home" is showing. The user clicks on "home".
    I don't want the division to do anything at all.


    function ShowHide(){

    if (document.getEl ementById('hide 2').style.displ ay ==
    document.getEle mentById('home1 ').style.displa y){
    document.getEle mentById('hide2 ').style.displa y = "none";
    } else {
    document.getEle mentById('hide2 ').style.displa y =
    document.getEle mentById('home1 ').style.displa y
    }
    }


  • SAM

    #2
    Re: how to not hide a division

    Le 11/2/08 10:27 PM, richard a écrit :
    In using the simple code below, how do I tell it NOT to hide a
    division when the link is clicked on if that division is already
    visible?
    >
    would it be as simple as using a 2nd function and setting that to
    "display" rather than "none"?
    >
    For instance, "home" is showing. The user clicks on "home".
    I don't want the division to do anything at all.
    >
    >
    function ShowHide(){
    >
    if (document.getEl ementById('hide 2').style.displ ay ==
    document.getEle mentById('home1 ').style.displa y){
    document.getEle mentById('hide2 ').style.displa y = "none";
    } else {
    document.getEle mentById('hide2 ').style.displa y =
    document.getEle mentById('home1 ').style.displa y
    }
    }
    >
    >
    don't know too much what could be this 'division' ...

    function ShowHide(){
    var home = document.getEle mentById('home1 ').style;
    var hide = document.getEle mentById('hide2 ').style;
    hide.display = home.display==' '? hide.display :
    hide.display==' '? 'none' : '';
    }

    function ShowHide(){
    var hide = document.getEle mentById('hide2 ').style;
    if(document.get ElementById('ho me1').style.dis play != '')
    hide.display = hide.display==' '? 'none' : '';
    }

    --
    sm

    Comment

    • Doug Gunnoe

      #3
      Re: how to not hide a division

      don't know too much what could be this 'division' ...

      I didn't see the term 'division' in regard to 'div' in HTML 4
      specification, but I think that most assume that's what it means.

      Comment

      Working...