xld
01-18-2007, 08:28 PM
1) Script Title:
Ultimate Fade-In Slideshow (v1.5)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
3) Describe problem:
Hello!
First off, this is an awesome script. However I ran into a problem with the new version of it. I've used an old one on this site: www.viefoto.se
The thing is, I modified it a bit. Since I don't know what I'm doing, it probably looks awful for someone who does. But it worked. Until now. Someone surfed in on the site with IE7 and the slideshow disappears when a menu item is clicked. I'm just guessing this is some IE7 thing because it works fine in all other browsers.
Here's the deal. I'd like to upgrade to the new version of the script, but it's a obviously a bit too advanced for me to mess around with. I tried to modify it so it would work like the previous one did, but I can't get it to work.
Here is what I want to do:
The images is stored in a list, seperated by spaces, in an external txt file. This is so it can be loaded into multiple pages and easily updated for someone who knows even less then me (try to imagine that!) about how it works. What I did with the previous script was to make the array one dimensional by cutting out the multidimensional stuff not needed anyway. At least, this is what I would like to believe I did. This is how it looks:
<script language="JavaScript1.2" type="text/javascript">
/***********************************************
* Ultimate Fade-In Slideshow: © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var slideshow_width='375px'
var slideshow_height='250px'
var pause=5000
var str='<!--#include virtual="/slide/slide.txt" -->'
var fadeimages=new Array()
fadeimages = str.split(" ");
////scriptet/////////////
var preloadedimages=new Array()
for (p=0;p<fadeimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=fadeimages[p]
}
var ie4=document.all
var dom=document.getElementById
if (ie4||dom)
document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden; border: 5px solid black"><div id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>')
else
document.write('<img name="defaultslide" src="'+fadeimages[0]+'">')
var curpos=10
var degree=10
var curcanvas="canvas0"
var curimageindex=0
var nextimageindex=1
function fadepic(){
if (curpos<100){
curpos+=10
if (tempobj.filters)
tempobj.filters.alpha.opacity=curpos
else if (tempobj.style.MozOpacity)
tempobj.style.MozOpacity=curpos/101
}
else{
clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML=insertimage(nextimageindex)
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0
var tempobj2=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj2.style.visibility="hidden"
setTimeout("rotateimage()",pause)
}
}
function insertimage(i){
var tempcontainer='<img src="'+fadeimages[i]+'" border="0">'
return tempcontainer
}
function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
tempobj.style.visibility="visible"
var temp='setInterval("fadepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=fadeimages[curimageindex][0]
curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0
}
function resetit(what){
curpos=10
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
if (crossobj.filters)
crossobj.filters.alpha.opacity=curpos
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=curpos/101
}
function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML=insertimage(curimageindex)
rotateimage()
}
if (ie4||dom)
window.onload=startit
else
setInterval("rotateimage()",pause)
</script>
The slide.txt file looks like this:
slide/slide1.jpg slide/slide2.jpg slide/slide3.jpg....etc
= the files seperated by spaces.
Ultimate Fade-In Slideshow (v1.5)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
3) Describe problem:
Hello!
First off, this is an awesome script. However I ran into a problem with the new version of it. I've used an old one on this site: www.viefoto.se
The thing is, I modified it a bit. Since I don't know what I'm doing, it probably looks awful for someone who does. But it worked. Until now. Someone surfed in on the site with IE7 and the slideshow disappears when a menu item is clicked. I'm just guessing this is some IE7 thing because it works fine in all other browsers.
Here's the deal. I'd like to upgrade to the new version of the script, but it's a obviously a bit too advanced for me to mess around with. I tried to modify it so it would work like the previous one did, but I can't get it to work.
Here is what I want to do:
The images is stored in a list, seperated by spaces, in an external txt file. This is so it can be loaded into multiple pages and easily updated for someone who knows even less then me (try to imagine that!) about how it works. What I did with the previous script was to make the array one dimensional by cutting out the multidimensional stuff not needed anyway. At least, this is what I would like to believe I did. This is how it looks:
<script language="JavaScript1.2" type="text/javascript">
/***********************************************
* Ultimate Fade-In Slideshow: © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var slideshow_width='375px'
var slideshow_height='250px'
var pause=5000
var str='<!--#include virtual="/slide/slide.txt" -->'
var fadeimages=new Array()
fadeimages = str.split(" ");
////scriptet/////////////
var preloadedimages=new Array()
for (p=0;p<fadeimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=fadeimages[p]
}
var ie4=document.all
var dom=document.getElementById
if (ie4||dom)
document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden; border: 5px solid black"><div id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>')
else
document.write('<img name="defaultslide" src="'+fadeimages[0]+'">')
var curpos=10
var degree=10
var curcanvas="canvas0"
var curimageindex=0
var nextimageindex=1
function fadepic(){
if (curpos<100){
curpos+=10
if (tempobj.filters)
tempobj.filters.alpha.opacity=curpos
else if (tempobj.style.MozOpacity)
tempobj.style.MozOpacity=curpos/101
}
else{
clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML=insertimage(nextimageindex)
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0
var tempobj2=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj2.style.visibility="hidden"
setTimeout("rotateimage()",pause)
}
}
function insertimage(i){
var tempcontainer='<img src="'+fadeimages[i]+'" border="0">'
return tempcontainer
}
function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
tempobj.style.visibility="visible"
var temp='setInterval("fadepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=fadeimages[curimageindex][0]
curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0
}
function resetit(what){
curpos=10
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
if (crossobj.filters)
crossobj.filters.alpha.opacity=curpos
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=curpos/101
}
function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML=insertimage(curimageindex)
rotateimage()
}
if (ie4||dom)
window.onload=startit
else
setInterval("rotateimage()",pause)
</script>
The slide.txt file looks like this:
slide/slide1.jpg slide/slide2.jpg slide/slide3.jpg....etc
= the files seperated by spaces.