PDA

View Full Version : Slideshow browser compatable



jamie smith
03-19-2005, 11:25 PM
Hello

I have adapted a slideshow script for my web page Which works in all browsers (i think) but only fades in IE 6. Does anybody know of a way to make it fade in Netscape?

Thankyou

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>PORTFOLIO</title>

<link href="port2.css" rel="stylesheet" type="text/css">
<link href="roll4.css" rel="stylesheet" type="text/css">

<script language="javascript" type="text/javascript">

var SlideShowSpeed = 3000;
var CrossFadeDuration = 2;
var picture = new Array();
var caption = new Array();
var links = new Array();

picture[0] = "pic/bcn2.jpg";
picture[1] = "pic/bcn1b.jpg";
picture[2] = "pic/bcn3.jpg";
picture[3] = "pic/bcn4.jpg";

caption[0] = "pic/btn1.gif";
caption[1] = "pic/btn2.gif";
caption[2] = "pic/btn3.gif";
caption[3] = "pic/btn4.gif";

links[0] = "#";
links[1] = "javascript:doImagePopUp1()";
links[2] = "http://www.google.com";
links[3] = "http://www.google.com";

count=0
preload= new Array()
for(i =0 ; i < picture.length; i++){
preload[i] = new Image();
preload[i].src = picture[i];
}

function control(how){
if (how=="F"){count++}
if (how=="B"){count--}

if(count<0){count=picture.length-1}
if(count>picture.length-1){count=0}

if (document.all){
document.images.picturebox.style.filter="blendTrans(duration=2)";
document.images.picturebox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.picturebox.filters.blendTrans.Apply();
}

document.images.picturebox.src = picture[count]
document.images.captionbox.src = caption[count]
document.getElementById("theLink").href = links[count];

if (document.all){
document.images.picturebox.filters.blendTrans.Play();
}

}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function doImagePopUp1(){
doImagePopUpWindow =window.open("big.htm","ImagePopup","left=20,top=150,width=450,height=251");
}
function setDescription(strText)
{
document.getElementById("objDescription").innerHTML = strText;
}

</script>
</head>
<body onLoad="showHot=true;self.focus(); MM_preloadImages('pic/arr1b.gif','pic/arr2b.gif','pic/bot1.gif','pic/bot2.gif','pic/bot4.gif','pic/bot5.gif','pic/bot6.gif')">

<div class="container">

<div class="btnbox"><img src="pic/btn1.gif" name=captionbox width=60 height=22></div>

<table width="390" border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td width="330"><a href="#" id="theLink"><img src="pic/bcn2.jpg" name=picturebox width=330 height=220 border=0></a></td>
<td width="60" valign="bottom"><a href="javascript:control('F');" class="aro2" ></a><a href="javascript:control('B');" class="aro1"></a></td>
</tr>
</table>
</div>
div>
</div>
</body>
</html>

jscheuer1
03-20-2005, 05:25 AM
Hi jamie,

This is a Dynamic Drive Scripts Help Forum so if this is a Dynamic Drive script, please give us a link to the original code, and please leave the Dynamic Drive credit intact when using it. If this is not a Dynamic Drive script, you are posting in the wrong forum, go to general coding, JavaScript. Anyways, this script looks somewhat familiar and I think it is only intended to fade in IE5+, 'filter="blendTrans' being proprietary to IE5+. There may be a way to adapt it using the -moz-opacity property to fade in NS however, that works differently than blendTrans and may not be adaptable here. I'll get back to you on that once you figure out where this script came from.

PLEASE: Include a link to your page that you want help with.