PDA

View Full Version : Site Check: Safari and Java Problems?



whiskey3
11-06-2005, 06:13 AM
Link here:

http://www.moldex.com/unitedstatesproducts.htm

In IE the javascript is fine but my client says in Safari they can't see the java anim. Are they missing a Saafari Java plugin or is it a security problem in Safari. I don't use Safari so I'm completely clueless why they can see the nav bar in Safari but not the java animation in the page?

Is there something in the code wrong?

Thanks.

jscheuer1
11-06-2005, 08:51 AM
If you are talking about the top graphic "Moldex - ideas that wear well", that's flash and they need a flash plugin for that. It may have to be the current one or at least one that can play the moldexheader.swf file. The javascript animation uses IE proprietary filters. It will not work in any other browsers. It can be modified to degrade to an ordinary non-fading slideshow. Replace the three 'runslideshow' functions with these:


function runslideshow1(){
if(document.all&&slideshow1.filters){slideshow1.style.filter="blendTrans(duration=2)"; }
if(document.all&&slideshow1.filters){slideshow1.style.filter="blendTrans(duration=crossFadeDuration1)"; }
if(document.all&&slideshow1.filters){slideshow1.filters.blendTrans.Apply(); }
document.images.slideshow1.src = preLoad1[currIMG1].src;
if(document.all&&slideshow1.filters){slideshow1.filters.blendTrans.Play(); }
currIMG1++
if (currIMG1 > (nPix1)){currIMG1=0}
setTimeout('runslideshow1()',slideshowSpeed1);
}

function runslideshow2(){
if(document.all&&slideshow1.filters){slideshow2.style.filter="blendTrans(duration=2)"; }
if(document.all&&slideshow1.filters){slideshow2.style.filter="blendTrans(duration=crossFadeDuration2)"; }
if(document.all&&slideshow1.filters){slideshow2.filters.blendTrans.Apply(); }
document.images.slideshow2.src = preLoad2[currIMG2].src;
if(document.all&&slideshow1.filters){slideshow2.filters.blendTrans.Play(); }
currIMG2++
if (currIMG2 > (nPix2)){currIMG2=0}
setTimeout('runslideshow2()',slideshowSpeed2);
}

function runslideshow3(){
if(document.all&&slideshow1.filters){slideshow3.style.filter="blendTrans(duration=2)"; }
if(document.all&&slideshow1.filters){slideshow3.style.filter="blendTrans(duration=crossFadeDuration3)"; }
if(document.all&&slideshow1.filters){slideshow3.filters.blendTrans.Apply(); }
document.images.slideshow3.src = preLoad3[currIMG3].src;
if(document.all&&slideshow1.filters){slideshow3.filters.blendTrans.Play(); }
currIMG3++
if (currIMG3 > (nPix3)){currIMG3=0}
setTimeout('runslideshow3()',slideshowSpeed3);
}

There are more compact ways of doing this, I just went with a global search and replace on lines using the word 'filter'. I don't have Safari but, FF exhibited the same symptoms, lets hope the same cure works as well.

Put another way, the script was really written only for IE.

You also need to remove onLoad="trap()" from the body tag because there is no function 'trap()'.

whiskey3
11-08-2005, 01:49 PM
I'm not talking about the flash animation but the javascript below....

I'm sorry if I didn't explain well enough....

Link here:

http://www.moldex.com/unitedstatesproducts.htm

The javascript in this page does not show in Safari only IE?
Does anybody know why it doesn't work in Safari?

Code Below:
-------------------------------------

<Script Language=javascript>
var slideshowSpeed1 = 3000;
var slideshowSpeed2 = 3000;
var slideshowSpeed3 = 3000;
var slideshowSpeed4 = 3000;
var crossFadeDuration1 = 3;
var crossFadeDuration2 = 3;
var crossFadeDuration3 = 3;
var crossFadeDuration4 = 3;

var currIMG1 = 0;
var currIMG2 = 0;
var currIMG3 = 0;
var currIMG4 = 0;

var Pic1 = new Array()
Pic1[0] = 'http://www.moldex.com/images/slideshow/foamplugs/plugstation.jpg'
Pic1[1] = 'http://www.moldex.com/images/slideshow/reusableplugs/rockets.jpg'
Pic1[2] = 'http://www.moldex.com/images/slideshow/reusableplugs/comets.jpg'
Pic1[3] = 'http://www.moldex.com/images/slideshow/foamplugs/purafit.jpg'
Pic1[4] = 'http://www.moldex.com/images/slideshow/foamplugs/sparkplugs.jpg'


var nPix1 = Pic1.length-1;
var preLoad1 = new Array()
for (i=0; i<nPix1+1; i++)
{
preLoad1[i] = new Image()
preLoad1[i].src = Pic1[i]
}

var Pic2 = new Array()
Pic2[0] = 'http://www.moldex.com/images/slideshow/disposables/2300n95.jpg'
Pic2[1] = 'http://www.moldex.com/images/slideshow/disposables/2315n99.jpg'
Pic2[2] = 'http://www.moldex.com/images/slideshow/disposables/2700n95.jpg'
Pic2[3] = 'http://www.moldex.com/images/slideshow/disposables/ez22n95.jpg'




var nPix2 = Pic2.length-1;
var preLoad2 = new Array()
for (n=0; n< nPix2+1; n++)
{
preLoad2[n] = new Image()
preLoad2[n].src = Pic2[n]
}

var Pic3 = new Array()
Pic3[0] = 'http://www.moldex.com/images/slideshow/8000series/8002.jpg'
Pic3[1] = 'http://www.moldex.com/images/slideshow/8000series/8102.jpg'
Pic3[2] = 'http://www.moldex.com/images/slideshow/8000series/8300.jpg'
Pic3[3] = 'http://www.moldex.com/images/slideshow/8000series/8602.jpg'


var nPix3 = Pic3.length-1;
var preLoad3 = new Array()
for (t=0; t<nPix3+1; t++)
{
preLoad3[t] = new Image()
preLoad3[t].src = Pic3[t]
}




function runslideshow1(){
slideshow1.style.filter="blendTrans(duration=2)";
slideshow1.style.filter="blendTrans(duration=crossFadeDuration1)";
slideshow1.filters.blendTrans.Apply();
slideshow1.src = preLoad1[currIMG1].src;
slideshow1.filters.blendTrans.Play();
currIMG1++
if (currIMG1 > (nPix1)){currIMG1=0}
setTimeout('runslideshow1()',slideshowSpeed1);
}

function runslideshow2(){
slideshow2.style.filter="blendTrans(duration=2)";
slideshow2.style.filter="blendTrans(duration=crossFadeDuration2)";
slideshow2.filters.blendTrans.Apply();
slideshow2.src = preLoad2[currIMG2].src;
slideshow2.filters.blendTrans.Play();
currIMG2++
if (currIMG2 > (nPix2)){currIMG2=0}
setTimeout('runslideshow2()',slideshowSpeed2);
}

function runslideshow3(){
slideshow3.style.filter="blendTrans(duration=2)";
slideshow3.style.filter="blendTrans(duration=crossFadeDuration3)";
slideshow3.filters.blendTrans.Apply();
slideshow3.src = preLoad3[currIMG3].src;
slideshow3.filters.blendTrans.Play();
currIMG3++
if (currIMG3 > (nPix3)){currIMG3=0}
setTimeout('runslideshow3()',slideshowSpeed3);
}



</Script>

</Head>
<Body>
<Table align="center">
<TR>
<TD align=center>
<a href="hearingprotection2.htm"><img src="slideshow1_1.jpg" name="slideshow1" width=200 height=150 border="0" id='slideshow1'></a><br></TD>
<TD align=center><a href="disposablerespirators.htm"><img src="slideshow2_1.jpg" name="slideshow2" width=200 height=150 border="0" id='slideshow2'></a></TD>
</TR>
<TR>
<TD align=center valign="top"><font size="3" face="Arial, Helvetica, sans-serif"><a href="hearingprotection2.htm"><strong>Hearing Protection</strong></a> </font></TD>
<TD align=center valign="top"><p><font size="3" face="Arial, Helvetica, sans-serif"><a href="disposablerespirators.htm"><strong>Disposable Respirators</strong></a> </font></p>
<p>&nbsp;</p></TD>
</TR>
<TR>
<TD align=center>
<a href="8000series.htm"><img src="slideshow3_1.jpg" name="slideshow3" width=200 height=150 border="0" id='slideshow3'></a><br></TD>
<TD align=center><a href="whatsnew.htm"><img src="images/slideshow/whatsnew.jpg" width="200" height="150" border="0"></a></TD>
</TR>
<TR>
<TD align=center><strong><font size="3" face="Arial, Helvetica, sans-serif"><a href="8000series.htm">8000 Series</a></font></strong></TD>
<TD align=center>&nbsp;</TD>
</TR>
</Table>
<p align="center"><!-- #BeginLibraryItem "/Library/copyright.lbi" --><!-- #BeginLibraryItem "/Library/copyright.lbi" --><font size="1" face="Arial, Helvetica, sans-serif"><strong><font color="#000000">&#169;
2003-2005 Moldex-Metric, Inc. All Rights Reserved.</font> </strong></font><!-- #EndLibraryItem --><!-- #EndLibraryItem -->
<Script>
runslideshow1();
runslideshow2();
runslideshow3();

</Script>