Hej jeg er i gang med at lave en flot og let udgave af en slags 'lightbox'.
Men dette er hvad der nogengange sker:
http://img329.imageshack.us/img329/4937/unavngivetww8.pngdet sjove/mærkelige er at nogengange virker det
Javascript:
function ShowImage(url,comment)
{
document.getElementById('imgholder').style.display="block";
document.getElementById('imgholder').innerHTML="<img src='"+url+"' alt='Billede' /><br /><br /><hr class='blackstripe' /><br /><p class='blacktxt'>" + comment + "</p><br /><hr class='blackstripe' />";
document.getElementById('temp').innerHTML="<img src='"+url+"' alt='Billede' id='tempimg' />";
var width = document.getElementById('tempimg').width;
var height = document.getElementById('tempimg').height;
#imgholder
{
position: absolute;
z-index: 3;
margin:0px auto;
padding: 20px;
padding-bottom: 10px;
background-color: #FFFFFF;
display: none;
text-align: center;
} document.getElementById('imgholder').style.width=width;
document.getElementById('imgholder').style.height=height;
document.getElementById('black').style.display="block";
heightofscreen = window.screen.height;
widthofscreen = window.screen.width;
if(height >= 780)
{
blackH = '110%';
document.write
document.getElementById('black').style.height=blackH;
}
document.bgColor = '#008000';
hPos = (heightofscreen/2)-(height/2);
wPos = (widthofscreen/2)-(width/2);
hPos = Math.round(hPos);
wPos = Math.round(wPos);
hPos -= 75;
hPos += "px";
wPos += "px";
document.getElementById('imgholder').style.top=hPos;
document.getElementById('imgholder').style.left=wPos;
}
CSS:
#imgholder
{
position: absolute;
z-index: 3;
margin:0px auto;
padding: 20px;
padding-bottom: 10px;
background-color: #FFFFFF;
display: none;
text-align: center;
}
body
{
background-color: #2970AD;
background-image: url('http://www.skatetown.dk/SkateDeveloper/images/bg.png');
background-repeat: repeat-x;
font-family: Verdana, Tahoma, arial;
font-size: 11px;
color: #FFFFFF;
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
}
Indlæg senest redigeret d. 21.01.2008 18:57 af Bruger #11328