I've got a version that is working very well here. It will only work in IE but, I got the idea that was all you wanted/needed:
Code:
<html>
<head>
<title>Automated Panoramic Viewer</title>
<style type="text/css">
#pano img {
filter:alpha(opacity=0);
}
</style>
</head>
<body onload="scroll()" bgcolor="#04222F">
<script type="text/javascript">
// load virtual tours
var images=new Array()
images[0]=["pan1.jpg", 2170]
images[1]=["pan2.jpg", 1970]
images[2]=["pan3.jpg", 1752]
var imgCount=0;
imname = 'pan1.jpg';
imwidth = 2170;
imheight = 400;
posleft = 0;
postop = 0;
panwidth = 2170;
panheight = 400;
// setup movement
speed= 60;
move= 2;
tim= 0;
imw=imwidth*panheight/imheight;imh=panheight;imstart=panwidth/2-imw*1.5;
jumpa=panwidth/2-imw*2.5;jumpwida=imw-move;
jumpb=panwidth/2-imw/2;jumpwidb=imw+move;
function scroll(){
now=parseFloat(document.getElementById("pano").style.left);
if (now<=jumpa+100){
for (var j_tem = 0; j_tem < document.images.length; j_tem++)
if(document.images[j_tem].src.indexOf(imname)!==-1)
document.images[j_tem].filters[0].opacity=parseInt(document.images[j_tem].filters[0].opacity, 10)-2
}
else if (now>jumpa+100){
for (var j_tem = 0; j_tem < document.images.length; j_tem++)
if(document.images[j_tem].src.indexOf(imname)!==-1&&document.images[j_tem].filters[0].opacity<100)
document.images[j_tem].filters[0].opacity=parseInt(document.images[j_tem].filters[0].opacity, 10)+2
}
if (now<=jumpa)
{
imgCount++
imgCount=imgCount<images.length? imgCount : 0
var pani=document.images
for (var i_tem = 0; i_tem < pani.length; i_tem++)
if (pani[i_tem].src.indexOf(imname)!==-1){
pani[i_tem].src=images[imgCount][0]
panwidth=imwidth=pani[i_tem].width=images[imgCount][1]
}
imname=images[imgCount][0]
imw=imwidth*panheight/imheight;imh=panheight;imstart=panwidth/2-imw*1.5;
jumpa=panwidth/2-imw*2.5;jumpwida=imw-move;
jumpb=panwidth/2-imw/2;jumpwidb=imw+move;
document.getElementById("pano").style.left=imstart+'px'
tim=setTimeout("scroll()",speed);
return;
}
else{
now-=move;
}
document.getElementById("pano").style.left=now;
tim=setTimeout("scroll()",speed);
}
document.write("<div id='panorama'>");
document.write("<div id='pano' style='position:absolute; left:"+imstart+"px; top:0px; width:"+imw*3+"px; height:"+imh+"px; z-index:2; visibility:visible;'>");
document.write("<table><tr><td nowrap><img galleryimg='no' src='"+imname+"' width="+imw+"px height="+imh+"px><img galleryimg='no' src='"+imname+"' width="+imw+"px height="+imh+"px><img galleryimg='no' src='"+imname+"' width="+imw+"px height="+imh+"px><\/td><\/tr><\/table>");
document.write("<\/div><\/div>");
document.write("<style>");
document.write("body { margin-left:0; margin-right:0; margin-top:0; margin-bottom:0;overflow:hidden;}");
document.write("#panorama {position:absolute; left:"+posleft+"px; top:"+postop+"px; width:"+panwidth+"px; height:"+panheight+"px; z-index:1; clip:rect(0px,"+panwidth+"px,"+panheight+"px,0px); overflow:hidden;}");
document.write("<\/style>");
</script>
</body>
</html>
Bookmarks