Hey Iedereen!
Ik zit met een probleemp.
Telkens als ik een javascript functie oproep dan springt mijn pagina naar de standaard positie.
Hoe los ik dit op?
Je vind een voorbeeld op: http://www.jamaswapi.be/test/index3.html
--> Scroll naar rechts. Druk op Start. En je zult zien dat het scherm terug naar links opschuift! En ik wil dit niet!
Kunnen jullie helpen?
Ik zit met een probleemp.
Telkens als ik een javascript functie oproep dan springt mijn pagina naar de standaard positie.
Hoe los ik dit op?
Je vind een voorbeeld op: http://www.jamaswapi.be/test/index3.html
--> Scroll naar rechts. Druk op Start. En je zult zien dat het scherm terug naar links opschuift! En ik wil dit niet!
Kunnen jullie helpen?
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
var tp1=60
var tp2=60
var tp3=60
var y
function startCount1()
{
document.getElementById('timeP1').innerHTML=tp1;
tp1=tp1-1;
y=setTimeout("startCount1()",1000);
}
function stopCount1()
{
clearTimeout(y)
}
</script>
</head>
<style>
body{
background-color:#980100;
width:1800px;
}
#score{
position:absolute;
bottom:0px;
left:200px;
width:1200px;
}
.name{
color:#FFFFFF;
font-size:36px;
text-align:center;
}
.time{
color:#FFFFFF;
font-size:120px;
text-align:center;
}
.player1{
width:200px;
height:200px;
float:left;
margin-right:100px;
}
.player2{
width:200px;
height:200px;
float:left;
margin-right:100px;
}
.player3{
width:200px;
height:200px;
float:left;
margin-right:100px;
}
</style>
<body>
<div id="score">
<div class="player1">
<div class="name">NAAM 1</div>
<div class="time" id="timeP1">60</div>
</div>
<div class="player2">
<div class="name">NAAM 2</div>
<div class="time" id="timeP2">60</div>
</div>
<div class="player3">
<div class="name">NAAM 3</div>
<div class="time" id="timeP3">60</div>
</div>
</div>
<div style=" position:absolute; right:-30px; top:50px">
<a href="#" onclick="startCount1()" style="background-image:url(start.png); padding:23px 123px 0px 0px;"></a>
<a href="#" onclick="stopCount1()" style="background-image:url(stop.png); padding:23px 123px 0px 0px;"></a>
</div>
</body>
</html>