// // available at http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// // // // phpThumb.demo.showpic.php // // James Heinrich // // 23 Feb 2004 // // // // This code is useful for popup pictures (e.g. thumbnails // // you want to show larger, such as a larger version of a // // product photo for example) but you don't know the image // // dimensions before popping up. This script displays the // // image with no window border, and resizes the window to // // the size it needs to be (usually better to spawn it // // large (600x400 for example) and let it auto-resize it // // smaller), and if the image is larger than 90% of the // // current screen area the window respawns itself with // // scrollbars. // // // // Usage: // // window.open('showpic.php?src=big.jpg&title=Big+picture', // // 'popupwindowname', // // 'width=600,height=400,menubar=no,toolbar=no') // // // // See demo linked from http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// ?> <?php echo @$_GET['title']; ?> '."\n"; echo 'if (((screen.width * 1.1) > '.$imgdata[0].') || ((screen.height * 1.1) > '.$imgdata[1].')) {'."\n"; // screen is large enough to fit whole picture on screen with 10% margin echo 'document.writeln(\'\');'; echo 'CrossBrowserResizeInnerWindowTo('.$imgdata[0].', '.$imgdata[1].');'."\n"; echo '} else {'."\n"; // image is too large for screen: add scrollbars by putting the image inside an IFRAME echo 'document.writeln(\'\');'; echo '}'."\n"; echo ''; } else { // cannot determine correct window size, or correct size too large: add scrollbars by putting the image inside an IFRAME echo ''; } ?>