Moin
hab nochmal eine Frage:
habe 2 Java-Codes und folgendes Problem:
möchte das beide Scripts gleichzeitig laufen es funktioniert aber bloß das eine
versuche schon die ganze zeit namen zu ändern bringt aber irgendwie nix
warum? bzw. eher wie krieg ich das gleichzeitig hin?
hier der Code:
<div id="bild1" class="imgtext">
<img style="border-width:2px; border-style:solid; border-color:#000000;" alt="Titel" title="Titel" src="images/buttons/story-a.jpg"/>
<br>Bildbeschriftung
</div>
<script type="text/javascript">
Position = 0; //Startposition des Bildes
document.getElementById("bild1").style.left = Position + "px";
function Bewegen() {
if (Position < 1) {
Position = Position - 15; //Pixel pro Aufruf
document.getElementById("bild1").style.left = Position + "px";
}
window.setTimeout("Bewegen()", 55); //Aufruf alle XXms 45
}
Bewegen();
</script>
<div id="bild2">
<img style="border-width:2px; border-style:solid; border-color:#000000;" alt="Titel" title="Titel" src="images/buttons/story-a.jpg"/>
</div>
<script type="text/javascript">
Position = 51; //Startposition des Bildes
document.getElementById("bild2").style.left = Position + "px";
function Bewegen2() {
if (Position > 50) {
Position = Position + 15; //Pixel pro Aufruf
document.getElementById("bild2").style.left = Position + "px";
}
window.setTimeout("Bewegen2()", 155); //Aufruf alle XXms 45
}
Bewegen2();
</script>
#bild1 {
background:blue;
position:fixed;
width:50%;
height:100%;
top:0px;
left:0px;
z-index:0;
}
#bild2 {
background:red;
position:fixed;
width:50%;
height:100%;
top:0px;
left:0px;
margin-left:50%;
z-index:0;
}
lg Thony