Vi have billedet til at vises i siden og ikke i popup
HejJeg sidder med en php skabelon hvor jeg er ved at lave et galleri som passer til siden, billederne vises i thumb og når jeg trykker på billedet så kommer det op i en popup der viser billedet i aktuel størrelse. jeg vil geren kunne vise billedet på selve gallerisiden og ikke i et popup.
Sådan ser koden ud på selve siden......:
<script type='text/javascript'>
<!--
sTitle = "$aProduct[name]";
//-->
</script>
<script type='text/javascript' src='$config[dir_js]checkForm.js'> </script>
<table height="310"cellspacing='0' cellpadding='0' style='border: 0px; width: 100%;' class='tekst'>
<tr>
<td class='product_show_name' width="140" valign="top">
<b>$aProduct[name]</b>
<br><span class='product_show_desc'>$aProduct[fullDescription]</span>
<td width="300" valign="middel" align="center">
HER SKAL BILLEDET VISES
</td>
<td align="right" width="300" height="300">
<div class="scroll">
$aFiles[photos]
</div>
</td>
</tr>
$aFiles[files]
</div>
</table>
<table cellspacing='0' cellpadding='0' style='border: 0px; width: 100%;' class='tekst'>
<tr>
<td align="right">
« <a href='java script:history.back();' class='tekst_b'>$lang[back]</a>
</td>
</tr>
</table>
<!-- END SHOW -->
<!-- BEGIN FOTO_DEFAULT -->
<a href='java script: windowFoto( "$aList[fotoBig]", sTitle+": $aList[description]" );'><img src='$aList[fotoSmall]' alt="$aList[description]" title="$aList[description]" class='product_show_foto' align='left' /></a>
<!-- END FOTO_DEFAULT -->
<!-- BEGIN FOTO_HEAD -->
<table cellspacing='0'>
<tr>
<td>
<!-- END FOTO_HEAD -->
<!-- BEGIN FOTO_LIST -->
<a href='java script:windowFoto( "$aList[fotoBig]", sTitle+": $aList[description]" );'><img src='$aList[fotoSmall]' alt="$aList[description]" title="$aList[description]" class='image_border' /></a>
<!-- END FOTO_LIST -->
<!-- BEGIN FOTO_FOOTER -->
</td>
</tr>
</table>
<!-- END FOTO_FOOTER -->
<!-- BEGIN FILES_HEAD -->
<tr>
<td>
<!-- END FILES_HEAD -->
<!-- BEGIN FILES_LIST -->
<img src='$aList[fotoSmall]' alt="$aList[description]" title="$aList[description]" class='product_show_foto' align='left' />
<!-- END FILES_LIST -->
<!-- BEGIN FILES_FOOTER -->
</td>
</tr>
<!-- END FILES_FOOTER -->
Sådan ser JS ud..............................:
function windowNew( sAdres, iWidth, iHeight, sTitle, iReturn ){
if ( !sTitle )
sTitle = '';
if( !iReturn )
iReturn = false;
if( !iWidth )
var iWidth = 750;
if( !iHeight )
var iHeight = 530;
if( +iWidth > 750 )
iWidth = 750;
else
iWidth = +iWidth + 40;
if( +iHeight > 530 )
iHeight = 530
else
iHeight = +iHeight + 40;
var iX = ( screen.availWidth - iWidth ) / 2;
var iY = ( screen.availHeight - iHeight ) / 2;
var refOpen = window.open( sAdres, sTitle, "height="+iHeight+",width="+iWidth+",top="+iY+",left="+iX+",resizable=yes,scrollbars=yes,status=0;" );
if( iReturn == true )
return refOpen
} // end function windowNew
function windowFoto( sFotoAdres, sTitle, sPageUrl, iReturn ){
if( !sTitle )
sTitle = 'Foto';
if( !iReturn )
iReturn = false;
if( !sPageUrl )
sPageUrl = '';
var refFoto = window.open( sPageUrl + "window.php?p=showFoto&adresFoto=" + sFotoAdres + "&tytylStrony=" + sTitle, 'Photo', "heigth=500,width=700,top=20,left=20,resizable=yes,scrollbars=yes,status=0;" );
if( iReturn == true )
return refOpen
Sådan ser windows.php ud:
<html>
<head>
<title>Photo</title>
<style>body{margin:0px;}</style>
<script>
<?php
if( ereg( 'Opera/8.00', $_SERVER['HTTP_USER_AGENT'] ) ){
?>
function reSizeToImage( ){
width = document.images[0].width + 20;
height = document.images[0].height + 40;
if( width > screen.availWidth ){
width = screen.availWidth - screen.availWidth / 5;
document.body.scroll = "yes";
}
if( height > screen.availHeight ){
height = screen.availHeight - screen.availHeight / 5;
document.body.scroll = "yes";
}
window.resizeTo( width, height );
moveWindowToImage( width, height );
}
<?php
}
else{
?>
var isNN,isIE;
if ( parseInt( navigator.appVersion.charAt( 0 ) ) >= 4 ){
isNN = ( navigator.appName == "Netscape" ) ? 1 : 0;
isIE = ( navigator.appName.indexOf( "Microsoft" ) != -1 ) ? 1 : 0;
}
function reSizeToImage( ){
if ( isNN ){
width = document.images["obrazek"].width;
height = document.images["obrazek"].height;
if( width > screen.availWidth ){
width = screen.availWidth - screen.availWidth/5;
document.body.scroll = "yes";
}
if( height > screen.availHeight ){
height = screen.availHeight - screen.availHeight/5;
document.body.scroll = "yes";
}
window.innerWidth = width;
window.innerHeight = height;
}
else {
window.resizeTo( 100, 100 );
width = 100 - ( document.body.clientWidth - document.images[0].width );
height = 100 - ( document.body.clientHeight - document.images[0].height );
if( width > screen.availWidth ){
width = screen.availWidth - screen.availWidth / 5;
document.body.scroll = "yes";
}
if( height > screen.availHeight ){
height = screen.availHeight - screen.availHeight / 5;
document.body.scroll = "yes";
}
window.resizeTo( width, height );
}
moveWindowToImage( width, height );
}
<?php
}
?>
function moveWindowToImage( iWindowWidth, iWindowHeight ){
var iPosX = ( screen.availWidth - iWindowWidth ) / 2;
var iPosY = ( screen.availHeight - iWindowHeight ) / 2;
window.moveTo( iPosX, iPosY );
} // end function moveWindowImage
function doTitle( ){
document.title = "<?php echo $_GET['tytylStrony']; ?>";
}
</script>
</head>
<body bgcolor='#ffffff' leftmargin='0' topmargin='0' scroll="no" onload="reSizeToImage( ); doTitle( ); self.focus( )" onclick="self.close( )">
<img name="obrazek" src='<?php echo $_GET['adresFoto']; ?>' alt="<?php echo $_GET['tytylStrony']; ?>" title="<?php echo $_GET['tytylStrony']; ?>" style="display: block;" /></body>
</html>
Kan i hjælpe mig .....med at få billedet vist hvor der står HER SKAL BILLEDET VISES på selve siden og ikke i et popupwindow.
Lars