script verschieben( problem)
lima-city → Forum → Die eigene Homepage → HTML, CSS & Javascript
anmerkung
attribut
ausgabe
bedeutung
bestimmten bereich
code
einzigem datei
einziges chaos
gott
kompletten code
kontext
links stehen
nachricht
pack
packen
position
positionieren
sagen
spruch
zufall
-
hi
kann mir einer sagen wie ich diesen script nach links bekomme er steht in der mitte obwohl kein befehl da ist. hier der script:
<form>
<button onclick=\"javascript:location.reload()\">Neue Zahl</a></button></form>
danke -
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage
-
HIER IST DER KOMPLETTE:
<script language=\"JavaScript\">
var z= 50;
quotes = new Array(z);
quotes[0] = \"Nothing is as easy as it looks.\"
quotes[1] = \"I found out she\'s an angel. I don\'t think she knows I know. I\'m worried that something might happen to me if anyone ever finds out.\"
quotes[2] = \"Every jumbled pile of person has a thinking part that wonder\'s what the part that isn\'t thinking isn\'t thing of.\"
quotes[3] = \"Love see\'s love\'s happiness. But happiness can\'t see that love is sad.\"
quotes[4] = \"Why the dancing, shouting, why the skrieks of pain? The lovely music, why the smell of burning autumn leaves?\"
quotes[5] = \"Thank you for the card with the cartoon nurse, but there\'s nothing wrong with me.\"
quotes[6] = \"You didn\'t enjoy it you never believed it there won\'t be a refund you\'ll never go back.\"
quotes[7] = \"Lad looks at other gals. Gal thinks Jim Bean is handsomer than lad, he isn\'t bad.\"
quotes[8] = \"I don\'t want the world. I just want your half.\"
quotes[9] = \"I could never sleep my way to the top, cause my alarm clock always wakes me right up.\"
quotes[10] = \"Mother nature is a bitch.\"
quotes[11] = \"It is impossible to make anything foolproof because fools are so ingenious.\"
quotes[12] = \"Whenever you set out to do something, something else must be done first.\"
quotes[13] = \"Every solution breeds new problems.\"
quotes[14] = \"Trust everybody ... then cut the cards.\"
quotes[15] = \"Two wrongs are only the beginning.\"
quotes[16] = \"If at first you don\'t succeed, destroy all evidence that you tried.\"
quotes[17] = \"To succeed in politics, it is often necessary to rise above your principles.\"
quotes[18] = \"Exceptions prove the rule ... and wreck the budget.\"
quotes[19] = \"Success always occurs in private, and failure in full view.\"
quotes[20] = \"Buy a Pentium 586/90 so you can reboot faster.\"
quotes[21] = \"2 + 2 = 5 for extremely large values of 2.\"
quotes[22] = \"Anything that can go wrong will go wrong.\"
quotes[23] = \"Computers make very fast, very accurate mistakes.\"
quotes[24] = \"My software never has bugs. It just develops random features.\"
quotes[25] = \"If anything simply cannot go wrong, it will anyway.\"
quotes[26] = \"Best file compression around: \\\"DEL *.*\\\" = 100% compression\"
quotes[27] = \"The Definition of an Upgrade: Take old bugs out, put new ones in.\"
quotes[28] = \"If everything seems to be going well, you have obviously overlooked something.\"
quotes[29] = \"BREAKFAST.COM Halted...Cereal Port Not Responding\"
quotes[30] = \"BUFFERS=20 FILES=15 2nd down, 4th quarter, 5 yards to go!\"
quotes[31] = \"It is impossible to make anything foolproof because fools are so ingenious.\"
quotes[32] = \"Bad command. Bad, bad command! Sit! Stay! Staaay...\"
quotes[33] = \"Every solution breeds new problems.\"
quotes[34] = \"As a computer, I find your faith in technology amusing.\"
quotes[35] = \"Two wrongs are only the beginning.\"
quotes[36] = \"Shell to DOS... Come in DOS, do you copy? Shell to DOS...\"
quotes[37] = \"All computers wait at the same speed.\"
quotes[38] = \"DEFINITION: Computer - A device designed to speed and automate errors.\"
quotes[39] = \"Success always occurs in private, and failure in full view.\"
quotes[40] = \"They say love is blind. I don\'t think you\'re blind.\"
quotes[41] = \"Everything takes longer than you think.\"
quotes[42] = \"Anything that can go wrong will go wrong.\"
quotes[43] = \"If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong.\"
quotes[44] = \"If there is a worse time for something to go wrong, it will happen then.\"
quotes[45] = \"If anything simply cannot go wrong, it will anyway.\"
quotes[46] = \"If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop.\"
quotes[47] = \"Left to themselves, things tend to go from bad to worse.\"
quotes[48] = \"If everything seems to be going well, you have obviously overlooked something.\"
quotes[49] = \"Nature always sides with the hidden flaw.\"
</script>
<script language=\"JavaScript\">
<!--
var jetzt=new Date();
var z=(jetzt.getSeconds())%50;
document.write(\"<font face=\'Arial,Helvetica,MS Sans Serif\'>\" + quotes[z] +\"</font>\");
//-->
</script> <form>
<button onclick=\"javascript:location.reload()\" align=\"left\">Neuer spruch</a></button></form>
<p>
-
*seufz*
Für die Positionierung ist vor allem der Kontext der anderen Seitenelemente von Bedeutung, das heißt es braucht schon den kompletten Code also auch das restliche HTML.
So, wie der Code dort steht, würde der Button links stehen.
Beitrag geändert: 7.3.2008 23:50:10 von xenodez -
also hier der komplette von der ganzen seite:
<script language=\"JavaScript\">
<!--
var quotenumber = 3; //Anzahl der Nachrichten
var randomnumber = Math.random() ;
var rand1 = Math.round( (quotenumber-1) * randomnumber) + 1 ;
quotes = new Array
quotes[1] = \"Auto\"
quotes[2] = \"Auto2\"
quotes[3] = \"immer wieder neu\"
var quote = quotes[rand1]
//-->
</script>
<script language=\"JavaScript\">
<!--
document.write(\"<b>\" + quote + \"</b>\")
//-->
</script>
<br><br>
<a href=\"javascript:onclick=history.go(0)\"><font color=\"dodgerblue\" face=\"arial\" size=\"2\">neue Nachricht laden...</font></a><br><br>
<head>
<title>Zufall</title>
<script type=\"text/javascript\">
function zufall(){
aBilder = new Array (\"http://s1.directupload.net/images/user/080226/stax2ppp.jpg\", \"http://s4.directupload.net/images/user/080226/9zo5omht.jpg\", \"http://s1.directupload.net/images/user/080226/lkzspykz.jpg\")
var index = Math.floor(Math.random()*aBilder.length);
document.getElementById(\"test\").style.backgroundImage = \"url(\"+aBilder[index]+\")\";
}
</script>
<style type=\"text/css\">
.bilder {
margin: 0;
width: 500px;
height: 400px;
border: none;
}
</style>
</head>
<body onload=\" zufall();\">
<div id =\"test\" class=\"bilder\"></div>
</body>
</html>
<button onclick=\"javascript:window.print();\">Diese Seite Drucken</button>
<button onClick=\"window.close()\">Seite Schließen</button>
<span id=\"temperatur\"></span>
<script type=\"text/javascript\">
document.getElementById(\'temperatur\').innerHTML = (48 + Math.round((Math.random()*100000000000000000))).toString() + \' °\';
</script
<td width=\"350\">
<div align=\"center\" id=\"textfeld_1\" style=\"font-size:16pt;\">
<script language=\"JavaScript\">
var z= 50;
quotes = new Array(z);
quotes[0] = \"Nothing is as easy as it looks.\"
quotes[1] = \"I found out she\'s an angel. I don\'t think she knows I know. I\'m worried that something might happen to me if anyone ever finds out.\"
quotes[2] = \"Every jumbled pile of person has a thinking part that wonder\'s what the part that isn\'t thinking isn\'t thing of.\"
quotes[3] = \"Love see\'s love\'s happiness. But happiness can\'t see that love is sad.\"
quotes[4] = \"Why the dancing, shouting, why the skrieks of pain? The lovely music, why the smell of burning autumn leaves?\"
quotes[5] = \"Thank you for the card with the cartoon nurse, but there\'s nothing wrong with me.\"
quotes[6] = \"You didn\'t enjoy it you never believed it there won\'t be a refund you\'ll never go back.\"
quotes[7] = \"Lad looks at other gals. Gal thinks Jim Bean is handsomer than lad, he isn\'t bad.\"
quotes[8] = \"I don\'t want the world. I just want your half.\"
quotes[9] = \"I could never sleep my way to the top, cause my alarm clock always wakes me right up.\"
quotes[10] = \"Mother nature is a bitch.\"
quotes[11] = \"It is impossible to make anything foolproof because fools are so ingenious.\"
quotes[12] = \"Whenever you set out to do something, something else must be done first.\"
quotes[13] = \"Every solution breeds new problems.\"
quotes[14] = \"Trust everybody ... then cut the cards.\"
quotes[15] = \"Two wrongs are only the beginning.\"
quotes[16] = \"If at first you don\'t succeed, destroy all evidence that you tried.\"
quotes[17] = \"To succeed in politics, it is often necessary to rise above your principles.\"
quotes[18] = \"Exceptions prove the rule ... and wreck the budget.\"
quotes[19] = \"Success always occurs in private, and failure in full view.\"
quotes[20] = \"Buy a Pentium 586/90 so you can reboot faster.\"
quotes[21] = \"2 + 2 = 5 for extremely large values of 2.\"
quotes[22] = \"Anything that can go wrong will go wrong.\"
quotes[23] = \"Computers make very fast, very accurate mistakes.\"
quotes[24] = \"My software never has bugs. It just develops random features.\"
quotes[25] = \"If anything simply cannot go wrong, it will anyway.\"
quotes[26] = \"Best file compression around: \\\"DEL *.*\\\" = 100% compression\"
quotes[27] = \"The Definition of an Upgrade: Take old bugs out, put new ones in.\"
quotes[28] = \"If everything seems to be going well, you have obviously overlooked something.\"
quotes[29] = \"BREAKFAST.COM Halted...Cereal Port Not Responding\"
quotes[30] = \"BUFFERS=20 FILES=15 2nd down, 4th quarter, 5 yards to go!\"
quotes[31] = \"It is impossible to make anything foolproof because fools are so ingenious.\"
quotes[32] = \"Bad command. Bad, bad command! Sit! Stay! Staaay...\"
quotes[33] = \"Every solution breeds new problems.\"
quotes[34] = \"As a computer, I find your faith in technology amusing.\"
quotes[35] = \"Two wrongs are only the beginning.\"
quotes[36] = \"Shell to DOS... Come in DOS, do you copy? Shell to DOS...\"
quotes[37] = \"All computers wait at the same speed.\"
quotes[38] = \"DEFINITION: Computer - A device designed to speed and automate errors.\"
quotes[39] = \"Success always occurs in private, and failure in full view.\"
quotes[40] = \"They say love is blind. I don\'t think you\'re blind.\"
quotes[41] = \"Everything takes longer than you think.\"
quotes[42] = \"Anything that can go wrong will go wrong.\"
quotes[43] = \"If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong.\"
quotes[44] = \"If there is a worse time for something to go wrong, it will happen then.\"
quotes[45] = \"If anything simply cannot go wrong, it will anyway.\"
quotes[46] = \"If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop.\"
quotes[47] = \"Left to themselves, things tend to go from bad to worse.\"
quotes[48] = \"If everything seems to be going well, you have obviously overlooked something.\"
quotes[49] = \"Nature always sides with the hidden flaw.\"
</script>
<script language=\"JavaScript\">
<!--
var jetzt=new Date();
var z=(jetzt.getSeconds())%50;
alert(quotes[z]);
//-->
</script> <form>
<button onclick=\"javascript:location.reload()\" align=\"left\">Neuer spruch</a></button></form>
<p>
<form>
<button value=\"Überraschung\" onclick=\"alert(\'Überraschung!\');\"> Was passiert?
</button></form>
</body>
</html> -
Hast du das alles in einer einzigen HTML Datei stehen? Das ist ja ein einziges Chaos.
-
ja es ist in einer einzigem datei wie kann ich es den sonst machen????
-
Hi,
Oh Mein Gott. Sortier das bitte erstmal... Du schließt beispielswiese am Ende
Du machst es aber nirgendswo auf^^</html>
Auch hast du 3 mal einen JavaScript-Bereich. Das solltest du in einen packen. Und dann willst du, wenn ich das richtig verstanden habe, die Ausgabe des Scriptes auf einen bestimmten Bereich auf deine HTML Seite haben. Das liegt, wie bereits gesagt, an den anderen HTML Elementen. Du musst also mit div z.B. deine Ausgabe richtig positionieren. Das kannst du dann über CSS erreichen. Hast du z.B. ein div, wo dann die Ausgabe drinnen ist, dann kannst du dieses div so positionieren:
div#deineid { left:100px; top:100px; }
Nur bitte pass auf, was du machst und produzier nicht so einen nicht-durchguckbaren Code!! Sonst kann dir hier niemand helfen. Oder du kannst das ganze mit position-absolute machen:
div#deineid { position:absolute; top:100px; left:100px; }
Wo das ausgegeben wird, wird bei dir glaube ich in der Funktion reload () definiert. Ich kenne mich mit JavaScript aber nicht so aus...
Yazurah
Anmerkung: Pack mal deinen ganzen Code in die Code-Tags...
Beitrag geändert: 8.3.2008 9:20:47 von yazurah -
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage