[CenterContent]

Dieses Script zentriert anhand der gewählten Auflösung automatisch die Inhalte der Webseite.

[Code]

[zwischen <HEAD> und </HEAD>]

<script type="text/javascript">
<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! http://www.nightfire.ch/java/
Created by: liveing sacrifice :: http://ls-design.forthelads.net */

function resize()
{
var wide = window.screen.availWidth
var high = window.screen.availHeight
var maxh = 600 // your max height here; enter 0 if not used
var maxw = 600 // your max width here; enter 0 if not used
var content = document.getElementById('content')
content.style.position = 'absolute'
if(maxh > 0 && high <= maxh)
{
content.style.height = high
}
if(maxw > 0 && wide <= maxw)
{
content.style.height = high
}
if(maxh > 0 && high > maxh)
{
content.style.height = maxh
high = (high - maxh) / 2
content.style.top = high
}
if(maxw > 0 && wide > maxw)
{
content.style.width = maxw
wide = (wide - maxw) / 2
content.style.left = wide
}
// Do not remove line below
content.innerHTML = content.innerHTML + "<p style='position:absolute;top:95%;width:40%;left:30%;'>provided by: <a href='http://www.nightfire.ch'>Nightfire Webdesign</a></p>"
}
//-->
</script>

[IN den <BODY> Tag]

onLoad="resize()"

[zwischen <BODY> und </BODY>]

<div id="content">
<p>
All your content would go here.</p>
</div>

[Autor]

liveing sacrifice

[Download]

Kopieren Sie bitte den Code

Copyright © 1998- Nightfire Webworker Archiv Script No: 648