Suche im Forum:
Suchen


Autor Nachricht
Beitrag14.04.2012 um 16:16 (UTC)    
Titel: Ladebalken Timer

Ladebalken Timer
Ich möchte gerne bei meinem Wartungsmodus einen Ladebalken haben der in einer bestimmten zeit von 0 % auf 100% geht.
Ich habe bis jetzt einen gefunden, aber er geht immer auf 0 % beim aktualisieren der Seite.
und ich möchte das er bei allen gleich viel % ist.
Hier ist mein Code:

Code:
<div style="text-align: center; ">
<div style="text-align: center; "><script type="text/javascript">
// JavaScript-Ladebalken mit Prozent-Anzeige
var zaehler = 1;
function load3(ziel) {
 if ( zaehler < ziel) {
  zaehler = zaehler + 1;
  document.getElementById("status3").style.width = zaehler + "px";
 var prozent = Math.round( zaehler/ziel * 100);
  document.getElementById("counter3").innerHTML = prozent+" %";
  window.setTimeout("load3('" + ziel + "')", 100);
 }
 else {
  zaehler = 1;
 }
}
</script>
<div style="position: relative;
width:400px; background-color: #BBBBBB; border: solid 1px #000000;">
<div style="text-align: left; "><span style="color: rgb(0, 0, 0); "><span id="counter3" style="position: absolute; width: 100%; z-index: 3; text-align: center; font-weight: bold; ">0 %</span></span></div>
<div id="status3" style="position: relative;
background-color: #0CFF29; width:0px; height: 22px;
border-right: solid 10px #0CFF29; z-index: 2;">&thinsp;</div>
</div>
</div>
</div>
<a href="javascript:load3('400');">Start</a>


Wenn es geht möchte ich das Design von dem behalten und wenn der Ladebalken auf 100 % ist,
dass man dann weitergeleitet wird.

Danke
Beitrag22.04.2012 um 16:32 (UTC)    
Titel: Ladebalken Timer / So geht es richtig!

Hi!
Versuche das mal so:

<dim style="text-align: center; ">
<dim style="text-align: center; "><script type="text/javascript">
// JavaScript-Ladebalken mit Prozent-Anzeige
var zaehler = 1;
function load3(ziel) {
if ( zaehler < ziel) {
zaehler = zaehler + 1;
document.getElementById("status3").style.width = zaehler + "px";
var prozent = Math.round( zaehler/ziel * 100);
document.getElementById("counter3").innerHTML = prozent+" %";
window.setTimeout("load3('" + ziel + "')", 100);
}
else {
zaehler = 1;
}
}
</script>
<dim style="position: relative;
width:400px; background-color: #BBBBBB; border: solid 1px #000000;">
<dim style="text-align: left; "><span style="color: rgb(0, 0, 0); "><span id="counter3" style="position: absolute; width: 100%; z-index: 3; text-align: center; font-weight: bold; ">0 %</span></span></div>
<dim id="status3" style="position: relative;
background-color: #0CFF29; width:0px; height: 22px;
border-right: solid 10px #0CFF29; z-index: 2;">&thinsp;</div>
</dim>
</dim>
</dim>
<a href="javascript:load3('400');">Start</a>

So... Du hast andauernd div verwendet. Habe da jetzt mal dim eingefügt.
Hoffe ich konnte helfen.

Meine Homepage: www.acwwcheatcodes.de.tl
Beitrag22.04.2012 um 18:40 (UTC)    
Titel: Re: Ladebalken Timer / So geht es richtig!

acwwcheatcodes hat Folgendes geschrieben:
So... Du hast andauernd div verwendet. Habe da jetzt mal dim eingefügt.

Ist irgendwas an mir vorbei gegangen?
Was ist falsch an Div-Elementen?

Übrigens funktioniert der Code mit der Änderung gar nicht mehr.

Gruß,

TransInt
______________
Kein Support per PN - Im Forum hilft es allen!

Life is what happens while you are busy making other plans.
- John Lennon
Beitrag23.04.2012 um 17:04 (UTC)    
Titel:

Des geht net.
Ich will es ja so haben das da kein Start steht.
ich möchte es gerne so haben:
( nur als Ladebalken )
Code:
<title>GameArea :: Wartungsmodus</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
<link href="style_warti.css" type="text/css" rel="stylesheet" />
<div id="content">
<div id="links_oben">&nbsp;</div>
<div id="middle">
<div id="right_wart">
<div id="right_mid">
<div style="text-align: center;"><span id="c1" style="font: bold 30px arial; color: #299C39;">0 TAGE</span><br />
<span id="c2" style="font: bold 25px arial; color: #FF0000;">05:08:20</span><br />
<font size="2"><br />
</font></div>
<script type="text/javascript">
// Erstellt mit dem Countdown-Generator - Homepage-Total.de
// Die Monatsnamen bitte in englisch eintragen (Monatsname, Tag, Jahr, Uhrzeit)
var end = new Date('03 28, 2013 20:00:00');

function toSt2(n) {
  var s = '';
  if (n < 10) {
   s += '0';
  }
  return (s + n).toString();
}

function toSt3(n) {
  var s = '';
  if (n < 10) {
   s += '00';
  }
  else if (n < 100) {
   s += '0';
  }
  return (s + n).toString();
}

function countdown() {
  var d = new Date();
  var count = Math.floor(end.getTime() - d.getTime());
  if (count > 0) {
    var miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    var seconds = toSt2(count%60); count = Math.floor(count/60);
    var minutes = toSt2(count%60); count = Math.floor(count/60);
    var hours = toSt2(count%24); count = Math.floor(count/24);
    var days = count;
    document.getElementById('c1').innerHTML = days + ' TAGE';
    document.getElementById('c2').innerHTML = hours + ':' + minutes + ':' + seconds
    setTimeout('countdown()', 100);
  }
}
countdown();
</script>  <center><br />
</center></div>
</div>
</div>
</div>
</meta>
</meta>
</meta>
</meta>
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de