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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show content for different browsers

Status
Not open for further replies.

SoupXVII

Technical User
Dec 15, 2000
36
IT
A site I'm working on is supposed to show different content for different browsers. The code I'm currently using works fine when viewed in Mozilla, IE or NN 6+. However, the display is messed up in NN 4. You can see the problem in action at The problem is the middle image. On load, the script correctly selects one of three images at random and places it inside a <DIV> tag. By clicking on little tabs below the image users can change the picture and clicking on the picture takes them to an appropriate page. The only thing that doesn't work is the position of the large image in NN4, it's off to the left. Any ideas how I could make it work? JS code for positioning the pic is:


if( Browser.shortName == &quot;NN&quot; ) {
div = &quot;NNlayer&quot;;
document.layers[ div ].document.open();
document.layers[ div ].left=238;
document.layers[ div ].top = 240;
document.layers[ div ].document.write( slike_sredina[broj] );
document.layers[ div ].document.close();
};


Thanks..
 
Hi,

NN 4 doesn't support the <div> tag. You need to do a browser dectect for NN 4 and if it's true then use an ilayer instead.

Rick It's a pleasure to know that I've helped you. If I have,
please click the link below to let me know. :)
 
Here's a NN4 detection script:

<script>
<!--
if(navigator.appName==&quot;Netscape&quot;){
if (navigator.appName==&quot;Netscape&quot;&&parseFloat(navigator.appVersion)==4){
document.write(&quot;<ilayer>&quot;);
} else{
document.write(&quot;<div>&quot;);
}
}
//-->
</script>

Rick It's a pleasure to know that I've helped you. If I have,
please click the link below to let me know. :)
 
>>NN 4 doesn't support the <div> tag
I recommend you ristmo2001 to read some good html tutorials...

There are some js errors on your page SoupXVII, type &quot;[tt]javascript:[/tt]&quot; in the adderss field to see them.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top