|
There is one downside of flying frames though... that is Netscape 4 and Opera 5 and below DO NOT view iframes at all. They just ignore iframes! On the other hand, with layers, its much better...why? Although many browsers recognize different tags for layers, you can use some Javascript to solve the problem!
- for IE: use the <div> tag.
- for Opera, the <div> tag also works. Yet, you have to tweak the values and adjust them manually
- for Netscape < 5.0 (N4.7X), use the <layer> tag.
- for Netscape > 5.0 (N6.0), use the <span> tag.
1) Get browser name
$Browser_Name = strtok($HTTP_USER_AGENT, "/");
$Browser_Version = strtok(" ");
2) Define browsers
//IE
if(ereg("MSIE", $HTTP_USER_AGENT))
{
$Browser_Name = "MSIE";
$Browser_Version = strtok("MSIE");
$Browser_Version = strtok(" ");
$Browser_Version = strtok(";");
}
// other browsers
3) use the right layer with the right browser:
if ($Browser_Name=="MSIE")
{
<div id="ie_layer" style="position:absolute; left:10px; top:85px;
width:745px; height:158px; z-index:1">
}
elseif ($Browser_Name=="Mozilla" & $Browser_Version < 5.0)
{
<layer id="nn4_layer" left="5" top="100" width="124" height="158"
z-index="2">
}
elseif ($Browser_Name=="Mozilla" & $Browser_Version >= 5.0)
{
<span id="nn6_layer" style="position:absolute; left:5px; top:100px;
width:124px; height:158px; z-index:2">
}
|