|
|
|
|
|
|
| |
Title : Popup window creator for images on the Fly.
Version: 1.0.0
Author: Mian Shafiq-ur-Rehman
Email : gurru@phpgurru.com
Mess : rehmanms@hotmail.com
Website: www.phpgurru.com
This program creates popups after calculating the Height and Width of image and
shows image in popup window according to the Height and Width.
| <script language="javascript">
function loadWindow(imgPath,width,height) {
var msgWindow = window.open("","Window_" + Math.floor(Math.random() * 10000000), "width=" + width +",height=" + height +"");
msgWindow.document.write("<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=windows-1256'>\n<title>Picture preview</title>\n</head>\n<body>\n");
msgWindow.document.write("<table width='100%' height='100%' border='1' cellpadding='10' cellspacing='5' bordercolor='#0066FF'>\n<tr>\n<td align='center' valign='middle'>\n");
msgWindow.document.write("<img src='" + imgPath +"'>");
msgWindow.document.write("</td></tr></table></body>\n</html>\n");
msgWindow.focus();
}
</script>
<?php
/*
I have uploaded the zip file in whoick complete code the written with images.
*/
function popup_window($imgPath)
{
if(file_exists($imgPath))
{
$size= @getimagesize( $imgPath );
$width=$size[0];
$height=$size[1];
$width = ($width < 200 ? 250 : ($width + 50));
$height = ($height < 300 ? 350 : ($height + 50));
$popup= "<a href='#' onClick=\"javascript:loadWindow('". $imgPath ."', " . $width . ", " . $height .");\">View Image</a>";
return $popup;
}
}
?> | |
Pass complete path of image to my routine and it will display a Link ~View Image~. On clicking this will open a new popup window according to the size of image. Kepp in mind that your popup blocker is turned off.
Usage Example
| <?php
echo popup_window("1.jpg") . "<br>";
echo popup_window("2.jpg") . "<br>";
echo popup_window("3.jpg") . "<br>";
echo popup_window("4.jpg") . "<br>";
?> | | |
|
| Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality. Categories : PHP, GD image library, Graphics | | | crop and resize image class using gd library function Categories : PHP, PHP Classes, GD image library, Graphics | | | PHP Email image generator - hide your email from bots - using the GD Library Categories : PHP, Graphics, GD image library, Beginner Guides | | | MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | Pull Down Surfing - Surf on Change Categories : Java Script, MySQL, HTML and PHP, PHP, Databases | | | Zephyr: AJAX Based Framework for PHP5 Developers Categories : PHP, AJAX, Frameworks, Java Script, Web Applications | | | Remote Scripting: send form POST data to a script and insert the results into a page without refreshing the page. Categories : PHP, AJAX, HTML and PHP, Java Script | | | Array values from javascript to php Categories : PHP, Java Script, Arrays | | | Create HTML forms dynamicly using Javascript & PHP Categories : PHP, PHP Classes, Java Script | | | PHP Interaction with Javascript windows Categories : Java Script, PHP | | | Builds JavaScript that updates the contents of one selector based on another. Categories : HTML, Java Script, PHP, Complete Programs, General | | | Linked comboboxes with php-mysql & javascript Categories : PHP, Java Script, Databases, MySQL | | | This is a script that list all image files on a given directory, and displays
the thumbnails nicely formated within an HTML table. It also make use of
JavScript to open pop up windows when the users want to see the full photo. Categories : Graphics, PHP, Complete Programs, Java Script | | | KuPro1.0 - This application is for Libraries, To see their books and to maintain users books. This version is in Turkish, future vers may have English Support.
Categories : PHP, Java Script, DHTML | | | The toll booth Categories : PHP, Java Script, Filesystem | |
|
|
|