Click to See Complete Forum and Search --> : urgent, mac bug on dropdowns!!!


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

khalidali63
05-30-2003, 12:01 PM
Originally posted by wynton_ca
It seems as though the mac IE doesnt like it very much.
wynton

don't you think that demands a bit more description that what exactly happens that you consider wrong...It will help people in there guess work to figure out your problem

wynton_ca
05-30-2003, 12:11 PM
i sure do.....multitasking ruins the mind.

anyway, so on the mac, when using IE, the showHide does not simply 'push' the rest of the content down the page and display the hidden table. instead it takes that table and plops it on top of the entire page, at the top, overriding any and all content on the page, no matter the z-index. in other words it doesnt function properly at all. this is using mac IE 5.x. netscape on the mac works fine, just like the pc, as to be expected. in other words, its nowhere near close. the hidden table is visible upon clicking the image, however parts of the underlying layout show through, almost like swiss cheese. the table does not show up where id expect it to.

hope that helps a little bit.

thanks

khalidali63
05-30-2003, 01:01 PM
My guess would be the
display:???
property..take a look at this resource it might be of some help
http://www.macedition.com/cb/ie5macbugs/