problems in mac using showHideLayers & onclick event

C

Charles

I have a site that's using frames, dhtml, javascript, flash, and every
other piece that might potentially choke a browser. Currently,
everything seems to be behaving except for the 'showHideLayers'
function on the Mac. I basically have two frames. when the user clicks
a link, it opens a new frame on the left and shows a new image that
resides in a <div> in the left frame. on the mac, the right frame page
opens, but the onclick event that fires the showHideLayers function
doesn't work. Code is below - any help is very appreciated!

javascript code:

<script language="JavaScript">
<!--

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function tmt_findObj(n){
var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
}else{x=document.getElementById(n)}return x;
}

function MM_showHideLayers() { //v3.0A Modified by Willy Wonka
var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
for (i=0; i<(args.length-2); i+=3){
obj=tmt_findObj(args);v=args[i+2];
v=(v=='show')?'visible':(v='hide')?'hidden':v;
if(obj)obj.style.visibility=v;}} else{
for (i=0; i<(args.length-2); i+=3) if
((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }}
}

//-->

</script>


## my link looks something like this (where i'm showing and hiding the
appropriate layers):

<a href="dominate.html" target="main"
onclick="MM_showHideLayers('dominate','','show');MM_showHideLayers('flash','','hide');MM_showHideLayers('manage','','hide');MM_showHideLayers('generate','','hide');MM_showHideLayers('decrease','','hide')"><img
src="images/menu2.jpg" border=0 hspace=0></a>


## and the div's are defined like this:

<div style="visibility: hidden" id="dominate"
style="position:absolute; width:501px; height:156px; z-index:1; left:
0px; top: 88px">
<img src="images/dominate.jpg">
</div>

<div style="visibility: hidden" id="manage" style="position:absolute;
width:501px; height:156px; z-index:1; left: 0px; top: 88px">
<img src="images/manage_growth.jpg">
</div>

<div style="visibility: hidden" id="generate"
style="position:absolute; width:501px; height:156px; z-index:1; left:
0px; top: 88px">
<img src="images/generate.jpg">
</div>

<div style="visibility: hidden" id="decrease"
style="position:absolute; width:501px; height:156px; z-index:1; left:
0px; top: 88px">
<img src="images/decrease.jpg">
</div>

## you can see the temp site at:
http://www.braintankstudios.com/astralnew2
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top