[Javascript] layers NN4x

Nancy Burton-Vulovic nancybv at flyinglemon.com
Fri Jul 19 09:34:23 CDT 2002


Not strictly Javascript, please forgive:

I am trying to fix (somebody else's) code - they have a layers command like
so:

<DIV id=Layer2
            style="Z-INDEX: 2; LEFT: 170px; VISIBILITY: hidden; WIDTH:
410px;  POSITION: absolute; TOP: 475px; HEIGHT: 262px">

In IE, the text is indeed 410px. In Netscape, it's about half that width. If
I set the clipping width to 410 within the style line (CLIP.WIDTH:410; ),
then it's the right width for Netscape - but of course, the visibility is no
longer hidden.

I've tried the following (last line is my addition):

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
{ v=args[i+2];
    if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v;
    if (obj.visibility=='visible') {obj.clip.width='410';}}

but it doesn't seem to recognize clip.width as a property of obj, although
it does if you put it in the style line itself.

help?!

Nancy






More information about the Javascript mailing list