Login
Про divы и валидность
122 просмотров
Перейти к просмотру всей ветки
in Antwort Stiner_rd 26.11.05 09:21, Zuletzt geändert 26.11.05 19:24 (scorpi_)
0. Всегда ставь px при указании размера если ты имеешь в виду пиксели.
1. Юзай getElementById
2. Юзай innerHTML вместо innerText
1. Юзай getElementById
2. Юзай innerHTML вместо innerText
<?xml version="1.1" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test</title>
<meta name="author" content="Stiner_rd" />
< style type="text/css">
#roll {
position: relative;
background-color: #0000FF;
border: solid 0px;
width: 30px;
height: 20px;
top: 0px;
left: 1px;
z-index: 2;
}
#proc {
position:relative;
text-align: center;
font-weight: bolder;
color: #c0c0c0;
border: solid black 1px;
width: 400px;
height: 20px;
top: -21px;
left: 0px;
z-index: 3;
}
</style>
<script language="JavaScript" type="text/javascript">
<!-- Start Script
var delay_time = 40; // msecs
var count = 0;
function updateProgress()
{
var roll = document.getElementById( "roll" ,0);
var proc = document.getElementById( "proc" ,0);
var wwidth = (window.innerWidth)?window.innerWidth: ((document.all)?document.body.offsetWidth:null,0);
if ( count < 400 ) {
proc.innerHTML = Math.floor(count/4) "%";
roll.style.width = count "px";
roll.style.left = wwidth / 2 - 200 1 "px";
proc.style.left = wwidth / 2 - 200 "px";
window.focus(,0);
setTimeout( "updateProgress()", delay_time ,0);
}
else
alert("ok",0);
}
</script>
</head>
<body onload="updateProgress()">
<br /><br /><br /><br />
<div style="height: 21px">
<div id="roll"> </div>
<div id="proc">0%</div>
</div>
</body>
</html>
PS Руки бы оторвать программисту этого сайта...