Java Script Bild-Scroller Problem

Dieses Thema im Forum "Web-Programmierung" wurde erstellt von mykill, 21.02.2007.

  1. mykill

    mykill Thread Starter MacUser Mitglied

    Beiträge:
    938
    Zustimmungen:
    0
    MacUser seit:
    25.03.2004
    HI

    Ich habe einen script nach meinen ANforderungen umgeschrieben und folgendes Problem:

    Die Bilder werden bei einigen Browser übereinander durchgescrollt und dann ruckt es so. wo ist mein Fehler

    Code:
    <script>
    <!--
    var sliderwidth = 80;
    var sliderheight = 350;
    var slidespeed = 1;
    var slidebgcolor = "#FFFFFF";
    var leftrightslide = new Array();
    var copyspeed = slidespeed;
    var i = 0;
    
    
    leftrightslide[i++] = '<a href="0001.html"><img src="media/scroll/1.jpg"></a>';
    leftrightslide[i++] = '<a href="0004.html"><img src="media/scroll/2.jpg"></a>';
    leftrightslide[i++] = '<a href="0005.html"><img src="media/scroll/3.jpg"></a>';
    leftrightslide[i++] = '<a href="0001.html"><img src="media/scroll/4.jpg"></a>';
    leftrightslide[i++] = '<a href="0004.html"><img src="media/scroll/5.jpg"></a>';
    leftrightslide[i++] = '<a href="0005.html"><img src="media/scroll/6.jpg"></a>';
    leftrightslide[i++] = '<a href="0001.html"><img src="media/scroll/7.jpg"></a>';
    leftrightslide[i++] = '<a href="0004.html"><img src="media/scroll/8.jpg"></a>';
    leftrightslide[i++] = '<a href="0005.html"><img src="media/scroll/9.jpg"></a>';
    leftrightslide[i++] = '<a href="0001.html"><img src="media/scroll/10.jpg"></a>';
    leftrightslide[i++] = '<a href="0004.html"><img src="media/scroll/11.jpg"></a>';
    leftrightslide[i++] = '<a href="0005.html"><img src="media/scroll/12.jpg"></a>';
    
    
    leftrightslide = '<br>' + leftrightslide.join(" ") + '</nobr>';
    var iedom = document.all || document.getElementById;
    if (iedom)
    	document.write('<span id="temp" style="visibility:hidden;position:absolute;left:-3000">' + leftrightslide + '</span>');
    var actualwidth = '';
    var cross_slide, ns_slide;
    
    function fillup(){
    	if (iedom){
    		cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
    		cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
    		cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
    		actualwidth=document.all? cross_slide.offsetHeight: document.getElementById("temp").offsetHeight;
    		cross_slide2.style.top=actualwidth;
    	}
    	else if (document.layers){
    		ns_slide=document.ns_slidemenu.document.ns_slidemenu2;
    		ns_slide2=document.ns_slidemenu.document.ns_slidemenu3;
    		ns_slide.document.write(leftrightslide);
    		ns_slide.document.close();
    		actualwidth=ns_slide.document.width;
    		ns_slide2.top=actualwidth;
    		ns_slide2.document.write(leftrightslide);
    		ns_slide2.document.close();
    	}
    	lefttime=setInterval("slideleft()",30);
    }
    window.onload=fillup;
    
    function slideleft(){
    	if (iedom){
    		if (parseInt(cross_slide.style.top)>(actualwidth*(-1)+8))
    			cross_slide.style.top=parseInt(cross_slide.style.top)-copyspeed;
    		else
    			cross_slide.style.top=parseInt(cross_slide2.style.top)+actualwidth+30;
    
    		if (parseInt(cross_slide2.style.top)>(actualwidth*(-1)+8))
    			cross_slide2.style.top=parseInt(cross_slide2.style.top)-copyspeed;
    		else
    			cross_slide2.style.top=parseInt(cross_slide.style.top)+actualwidth+30;
    	}
    	else if (document.layers){
    		if (ns_slide.top>(actualwidth*(-1)+8))
    			ns_slide.top-=copyspeed;
    		else
    			ns_slide.top=ns_slide2.top+actualwidth+30;
    
    		if (ns_slide2.top>(actualwidth*(-1)+8))
    			ns_slide2.top-=copyspeed;
    		else
    			ns_slide2.top=ns_slide.top+actualwidth+30;
    	}
    }
    
    if (iedom||document.layers){
    	with (document){
    		document.write('<table border="0" cellspacing="0" cellpadding="0"><td>');
    		if (iedom){
    			document.write('<div style="position:relative;width:' + sliderwidth + ';height:' + sliderheight + ';overflow:hidden">');
    			document.write('<div style="position:absolute;width:' + sliderwidth + ';height:' + sliderheight + ';background-color:' + slidebgcolor + '" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">');
    			document.write('<div id="test2" style="position:absolute;bottom:0;top:0"></div>');
    			document.write('<div id="test3" style="position:absolute;bottom:-1000;top:0"></div>');
    			document.write('</div></div>');
    		}
    		else if (document.layers){
    			document.write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>');
    			document.write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>');
    			document.write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>');
    			document.write('</ilayer>');
    		}
    		document.write('</td></table>');
    	}
    }
    
    //-->
    </script>
    
    Vielen Dank
     
Die Seite wird geladen...
Ähnliche Themen - Java Script Bild
  1. Ronny77
    Antworten:
    14
    Aufrufe:
    875
    Ronny77
    11.10.2010
  2. Swyti
    Antworten:
    5
    Aufrufe:
    1.535
    Swyti
    07.03.2010
  3. LongDongLude
    Antworten:
    1
    Aufrufe:
    434
    msslovi0
    07.07.2008
  4. Marco_Bochum
    Antworten:
    1
    Aufrufe:
    428
    mores
    06.06.2007
  5. 9fj
    Antworten:
    7
    Aufrufe:
    2.277
    Pingu
    05.10.2005