Results 1 to 2 of 2

Thread: dhtml layers question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    dhtml layers question

    i have two div tags. one is visible until a radio button is clicked.
    i then have another one shown.

    i need to make the first one hidden.

    here is my code
    Code:
    function toggle(id2,id) {
         document.all[id2].style.visibility = "visible" ;
         document.all[id].style.visiblity = "hidden";
    }
    <DIV ID="divShowHide" STYLE=" position:relative;visibility:visible; "> 
      <table>
        <tr> 
          <td>Do you like green eggs and ham?
          </td>
        </tr>
        <tr> 
          <td><input type="radio" name="answer" onClick="toggle('toggleOff','divShowHide');">
            A. Yes</a> <br> <input type="radio" name="answer" onClick="toggle('toggleOff','divShowHide');">
            B. No</a> </td>
        </tr>
      </table>
    </DIV>
    
    <div id="toggleOff" style="visibility:hidden;position:relative; "> 
      <table border="1" bordercolor="#FF9900">
        <tr> 
          <td>who cares what you like.</td>
        </tr>
      </table>
    </div>
    any suggestions are welcome.
    thanks
    pnj

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    This is IE-specific code.


    Code:
    function toggle(id2,id) {
      if(navigator.userAgent.indexOf("MSIE") != -1 && parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE")+5)) < 5.5) {
        document.all[id2].style.visibility = "visible" ;
        document.all[id].style.visiblity = "hidden";
      } else {
         document.getElementById(id2).style.visibility = "visible";
      document.getElementById(id).style.visibility = "hidden";
      }
    }
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width