wynton_ca
05-30-2003, 11:28 AM
Hey guys and gals,
I have this script working perfectly for both netscape 6.x and IE 5 and up. However, I just browsed my script with the mac and well, it doesnt look so good. It seems as though the mac IE doesnt like it very much. Mac netscape is fine. I shoulda figured this would happen. Ive ran out of ideas, as Im not a .js expert, especially when it comes to the land of macs!! Below is the javascript im using. If you can spot anything that might help me, please please please let me know!
Thanks!
Wynton
<script>
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new checkBrowser()
//With nested layers for netscape, this function hides the layer if it's visible and visa versa
function showHide(div){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
if(obj.display=='inline' || obj.display=='show') obj.display='none'
else obj.display='inline'
}
//Shows the div
function show(div,nest){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
obj.display='inline'
}
//Hides the div
function hide(div,nest){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
obj.display='none'
}
</script>
<a href="#" onclick="showHide('yourID');"><img src="image.gif" width="113" height="27" alt="Show Details" border="0" name="showdetail"></a>
<table ID="yourID" style="display:none;" width="747" cellspacing="0" cellpadding="0" border="0">
<tr><td>your test layer right up in here</td></tr>
</table>
thanks again,
wynton
I have this script working perfectly for both netscape 6.x and IE 5 and up. However, I just browsed my script with the mac and well, it doesnt look so good. It seems as though the mac IE doesnt like it very much. Mac netscape is fine. I shoulda figured this would happen. Ive ran out of ideas, as Im not a .js expert, especially when it comes to the land of macs!! Below is the javascript im using. If you can spot anything that might help me, please please please let me know!
Thanks!
Wynton
<script>
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new checkBrowser()
//With nested layers for netscape, this function hides the layer if it's visible and visa versa
function showHide(div){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
if(obj.display=='inline' || obj.display=='show') obj.display='none'
else obj.display='inline'
}
//Shows the div
function show(div,nest){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
obj.display='inline'
}
//Hides the div
function hide(div,nest){
obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
obj.display='none'
}
</script>
<a href="#" onclick="showHide('yourID');"><img src="image.gif" width="113" height="27" alt="Show Details" border="0" name="showdetail"></a>
<table ID="yourID" style="display:none;" width="747" cellspacing="0" cellpadding="0" border="0">
<tr><td>your test layer right up in here</td></tr>
</table>
thanks again,
wynton