Will this work in Netscape and IE?

M

Mark

Hi - I had a post below about showing/hiding in IE and Netscape - could
someone please verify my revised code below and say if it will work in
both (I only have access to IE).

Thank you,

...in head...
<script language="JavaScript" type="text/JavaScript">
<!--

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function show(faq){
if (obj=MM_findObj(faq)!=null) {
obj=MM_findObj(faq)
if (obj.style){ obj=obj.style;
v=obj.visibility;
if (v=='visible'){v='hidden';d='none';}
else {v='visible';d='block';}
obj.visibility=v;
obj.display=d;
}
}
}
//-->
</script>

...in body...

<div onClick="show('Layer1')">click here</div>

<table border=2><tr><td>
<div id="Layer1"
style="visibility:hidden;display:none">asdasdsdadasdasd<br>dsdasasddas<b
r>dasdasdasdasdasdas<br>asdasdasdasdsd<br>asdasdasdasdasda</div>
</td></tr></table>
 
K

kaeli

Hi - I had a post below about showing/hiding in IE and Netscape - could
someone please verify my revised code below and say if it will work in
both (I only have access to IE).

If you had a complete page and a link, it would be a lot easier for
people to help you test.

Geocities, Angelfire, and other places have free sites - if your page is
intranet or local, you could put examples there with the minimum code it
takes to showcase your problem or what you want tested. Then we'd just
click the link and let you know if it works.

--
~kaeli~
Kill one man and you are a murderer. Kill millions and you
are a conqueror. Kill everyone and you are God.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top