Float virker ikke i IE
Hej Jeg har dette script på en side, det virker fint under firefox men ikke på IE6 og IE7.I firefox folader slide shovet fint op on ned på siden alt efter positionen, men under IE står det bare fast.
Jeg kan se at jeg får en fejl i linie 129 at 'nul' er null eller ikke et objekt.
Koden kommer her:
/* Floating Slide Show Script C.2004 by CodeLifter.com */
// You *must* add onload="runSlideShow()" to the body tag
// of the page.
// In the section marked Edit the HTML, above, remember to
// set the path and size for the first image.
// =======================================
// Set the following variables
// =======================================
// Set slideShowSpeed (milliseconds):
var slideShowSpeed = 3000
// Duration of crossfade (seconds) for IE:
var crossFadeDuration = 300
// Set the positioning variables, below:
// Negative numbers are relative to right (whereX) or bottom (whereY)
// Positive numbers are relative to left (whereX) or (whereY) top
// Experiment with values to get positioning exact, and allow
// for the dimensions of the image in the positioning
var whereX = 10;
var whereY = 500;
//var nn=(navigator.appName.indexOf("Netscape")!=-1);
//whereY = nn?innerHeight-255:document.body.clientHeight-255;
var winWidth, winHeight, d=document;
if (typeof window.innerWidth!='undefined') {
winWidth = window.innerWidth;
winHeight = window.innerHeight;
} else {
if (d.documentElement &&
typeof d.documentElement.clientWidth!='undefined' &&
d.documentElement.clientWidth!=0) {
winWidth = d.documentElement.clientWidth
winHeight = d.documentElement.clientHeight
} else {
if (d.body &&
typeof d.body.clientWidth!='undefined') {
winWidth = d.body.clientWidth
winHeight = d.body.clientHeight
}
}
}
whereY = winHeight-255;
// Specify the image files:
var Pic = new Array() // don't touch this!
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = 'fileadmin/templates/osteoporose/pictures/dancer_1.jpg'
Pic[1] = 'fileadmin/templates/osteoporose/pictures/dancer_2.jpg'
Pic[2] = 'fileadmin/templates/osteoporose/pictures/dancer_3.jpg'
// =======================================
// Do not edit *anything* below this line!
// =======================================
var nn=(navigator.appName.indexOf("Netscape")!=-1);
var t;
var j=0;
var p=Pic.length;
var preLoad=new Array();
for (i=0;i<p;i++){
preLoad[i]=new Image();
preLoad[i].src = Pic[i];
}
var oneTime = false;
function runSlideResize() {
oneTime = false;
runSlideShow();
}
function runSlideShow() {
whereX = nn?innerWidth:document.body.clientWidth;
if (nn)
whereX = ((window.innerWidth-document.body.clientWidth) !=0 )?(whereX - 6 ):(whereX);
whereX = (whereX > 750)? (whereX/2-355): 27;
if (!oneTime) {
floatSS(whereX,whereY,'FloatSlideShow').Fss();
oneTime = true;
}
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
if (document.all || document.getElementById)
{
document.images.SlideShow.src = preLoad[j].src;
}
else
{
document.FloatSlideShow.document.images["SlideShow"].src = preLoad[j].src;
}
if (document.all)
{
document.images.SlideShow.filters.blendTrans.Play();
}
j=j+1;
if (j>(p-1))j=0;
t=setTimeout('runSlideShow()', slideShowSpeed);
}
function floatSS(iX,iY,id){
var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';
var L = dD.getElementById ? dD.getElementById(id) : dD.all ? dD.all[id] : dD.layers[id];
this[id+'O']=L;
if(dD.layers)L.style=L;
L.nX=L.iX=iX;
L.nY=L.iY=iY;
L.P=function(x,y){
this.style.left=x+px;
this.style.top=y+px;
};
L.Fss=function(){
var pX, pY;
if (this.iX >=0){
pX = 0;
} else {
if (nn){
pX = innerWidth;
} else {
if (nn&&dH.clientWidth){
pX = dH.clientWidth;
} else {
pX = dB.clientWidth;
}
}
}
//pX=(this.iX >=0)? 0 : nn ? innerWidth : nn&&dH.clientWidth ? dH.clientWidth : dB.clientWidth;
//pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
if (nn){
pY = pageYOffset
} else {
if (nn&&dH.scrollTop){
pY = dH.scrollTop;
} else {
pY = dB.scrollTop;
}
}
if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
this.nX+=.1*(pX+this.iX-this.nX);
this.nY+=.1*(pY+this.iY-this.nY);
this.P(this.nX,this.nY);
setTimeout(this.id+'O.Fss()',33);
};
return L;
}
floatSS(whereX,whereY,'FloatSlideShow').Fss();
Nogen som har en ide.
