Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layer .style.display=block not responding in Mac Opera

Status
Not open for further replies.

clemrock

Programmer
May 20, 2004
118
0
0
US
Hello,

I'm trying to toggle some layers using the layer.style.display = block/ layer.style.display=none method and it works fine in ever browser except Mac Opera, Mac/Windows Netscape 4.

I know these browsers handle layers differently and I've tried to use this method w/ no effect:

layer.style.visibility = 'visible'; layer.style.visibility = 'visible';

Here's the code I'm using that works in every browser:
Code:
function toggle_layers( this_div ) 
{
      doc = document.getElementsByTagName('div');		

       for( var i = 0; i < doc.length; i ++ ) 
       {		   	    
              if( this_div == doc[i].id )
              {
	              doc[i].style.display = 'block';  
              }
              else
              {
                      doc[i].style.display = 'none';  
              }
}

thanks for any help you can give me.

Clem C
 
If I recall correctly (because let's face it, NN4 is sooooooo old, and pretty much pointless to support these days), NN4 does not support DIV elements - it had it's own "<layer>" element... so this might explain why you can't get it working in NN4.

Do you really need to support such an archaic browser?

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I would still like to get it to work in as many browsers as possible and I would like to figure this out for my own learning.

I'm stubborn that way.
 
Well - if NN4 doesn't support DIV elements (which I recall from working with it back in 1999 that it doesn't)... you might not have any choice bbut to drop support, or use the <layer> element instead.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
What about latter versions of Opera? I Know there is some support for layers but not things such as transparancies.

Thanks again.
 
Given that Opera has gone through 3 major revisions (and countless minor ones) since that version, I really think you need to utilise to 80/20 rule (or in this case, the 99/1 rule)... i.e. don't waste 99% of your time tryijg to use a browser that only 1% will use - if that. I seriously doubt anyone still uses these old browsers.

You've said it yourself - you're stubborn like that. Get over it - tailor your apps / site to modern browsers with modern support. Youre site will be a lot better for it.

Take it from one who knows - I spent many days getting my own site to look good in Mac IE and Opera, and even IE 5.0... when I look at my logs a year on, I realise it was pretty much a waste of time.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan's right. You'd have to be dealing with a pretty niche audience to need to cater for those browsers.

In an ideal world all that we do would work in every browser. However out here in the real world we have to balance effort with gain. Is it really worth expending so much effort on browsers that such a small number of users may still be using?

With all the sites I am involved in, I can't recall the last time I saw a visit from a V4 browser. Even when I fired up a dusty old machine of mine (P233MMX, 256Mb RAM) running Windows 98SE, it still had IE6 installed, and when I used that machine I was using a 33.6Kb modem yet still kept it updated.

I doubt very much whether the usae figure is even anywhere near 1%. Of course it depends on the type of site. But how about considering that by catering for these very old browsers we are prolonging their existence? Is that a good thing? Even old operating systems will run more modern browsers than NN4!

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
At this point all these arguments are correct.

I really just want to find a solution for my own knowlege.

I have the time to learn why this isn't working.

 
It could potentially be a known issue with that early version of Opera. try looking at the knowledgebase on Opera's website, or visit some forums and search for posts > 4 years ago (or whatever date that version of Opera was in use).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top