#1
  1. No Profile Picture
    barry@usa.net
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm currently freeked out by this can someone please show me an example where NS actually works?

    This works in IE:

    <HTML>
    <SCRIPT TYPE="javascript">
    function test()
    {
    document.all.Barr.style.visibility = "hidden";
    }
    </SCRIPT>

    <BODY >
    <FORM>
    <INPUT type=checkbox name=r1 onclick=test()>Radio1<br>

    <DIV ID="Barr" Style="visibility:visible">

    <INPUT type=radio name=r2 >Radio2<br>
    <INPUT type=radio name=r3 >Radio3<br>
    <INPUT type="text" name=r2><br>

    </DIV>
    </FORM>
    </BODY>
    </HTML>


    I know I need to change this line:

    document.all.Barr.style.visibility = "hidden";


    but to what?


    ------------------
    Barry
  2. #2
  3. No Profile Picture
    Spookster
    Guest
    Devshed Newbie (0 - 499 posts)
    Try this:

    function test(){
    //--document.layers detects NS
    if (document.layers){
    document.Barr.visibility='hide';
    }
    //--document.all detects IE
    else if (document.all){
    Barr.style.visibility='hidden';
    }
    }

    Spookster
  4. #3
  5. No Profile Picture
    time2brew
    Guest
    Devshed Newbie (0 - 499 posts)
    i agree with spookster, but you need to take the style attribute off of the div

    not <DIV id="Barr" STYLE...
    but <DIV Id="Barr">
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Rumilly, HS, France
    Posts
    8
    Rep Power
    0
    In the STYLE properties, you have to set the attribute POSITION as ABSOLUTE. If you don't do that, your DIV element won't be considered as a LAYER in NS.

    <DIV STYLE="position:absolute; .." ..

    KliK

Similar Threads

  1. Replies: 7
    Last Post: August 8th, 2014, 07:30 AM
  2. div layer visibility problems
    By SBee in forum HTML Programming
    Replies: 2
    Last Post: January 17th, 2004, 03:30 PM
  3. Replies: 1
    Last Post: September 1st, 2003, 01:52 AM
  4. Div tag visibility
    By kgb-fbi in forum HTML Programming
    Replies: 3
    Last Post: August 1st, 2003, 04:14 AM
  5. hiding and showing div layers
    By bramsey in forum HTML Programming
    Replies: 2
    Last Post: January 10th, 2002, 09:09 AM

IMN logo majestic logo threadwatch logo seochat tools logo