Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

visibility in netscape 7

JasonZJasonZ Member Posts: 1
This works fine in IE, and its not throwing any javscript errors in ns6+ or in ie, but it won't change the visibility in netscape.

I have tried document.layer['div_name'].style.visibility as well, but to no prevail.

I have got them to hide now, but only by setting the nested styles for each div to "hidden" which is strange as I thought netscape sued hide and show, not hidden and visible?

Here is the code, am I missing something?







-Jason

Comments

  • richard_wise25richard_wise25 Member Posts: 52
    I am also having trouble accessing div's and span's in Netscape through the document object model. If you go to http://developer.netscape.com/ and read their section on DHTML, and try running it, it does not work(hint type in javascript:) in the address bar to view javascript errors. I have contacted netscape but to no avail.
  • gaspardgaspard Member Posts: 14
    : This works fine in IE, and its not throwing any javscript errors in ns6+ or in ie, but it won't change the visibility in netscape.
    :
    : I have tried document.layer['div_name'].style.visibility as well, but to no prevail.
    :
    : I have got them to hide now, but only by setting the nested styles for each div to "hidden" which is strange as I thought netscape sued hide and show, not hidden and visible?
    :
    : Here is the code, am I missing something?


    JASON: I have found that with NS 4.78 (not sure about the new ones)

    if you make a , and don't make it visible as default, you will not be able to un-hide it...

    so, if for example you use:

    [code]

    [layer stuff in here...]

    [/code]

    your layer will [red][b]never[/b][/red] be seen, even if you use:

    [code]
    //this is NS4 javascript
    document.layers['gimp'].style.visibility = "show";
    [/code]


    but... if you start the layer with:

    [code]

    [layer stuff in here...]

    [/code]

    your layer [red][b]can[/b][/red] be seen, and if you want to hide it you [red][b]can[/b][/red] use:

    [code]
    //this is NS4 javascript
    document.layers['gimp'].style.visibility = "hide";
    //and to unhide use:
    document.layers['gimp'].style.visibility = "show";
    [/code]

    of course IE5+ is much easier, it doesn't have these hard coding rules, in fact you could document.write(); out the whole page and it will still recognize your DHTML control with document.all.divname.style

    for example, if you want to start with a hidden layer which shows later on in the page's use, NS is not the best, it will hide once shown, but cannot start invisible, although you could cover it with another layer at a higher z-index...

    -Gaspard
Sign In or Register to comment.