TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

A Question

Page: 1 Reply
Mar 17th 2003#95673 Report
Member since: Sep 16th 2002
Posts: 1876
Ok.

1. How would I go about making a graphic open up in it's own window, it's own size, and have it close when the viewer clicks anywhere on it? (like on Paavo's gallery)

Thanks.
Reply with Quote Reply
Mar 17th 2003#95698 Report
Member since: Nov 26th 2001
Posts: 2586
Here is a sample from my site that should point you in the right direction. Now Paavo or another of our great Javascript coders may be able to write something a little less cody,

< a href="javascript:void(0);" target="_blank" onClick="OpenWindow('gallery/photo1.htm', 'aruna', 400,315,'scrollbars=no,menubar=no,toolbar=no,location=no,status=no,resizable=no'); return false" onMouseOver="window.status='Aruna Mohanty @ the Recording Lair';return true" onMouseOut="window.status='Mardala.com';return true">[¥] < /a >


Then in a javascript section I would define OpenWindow() like this:

function OpenWindow( url, name, width, height, options )
{
var newWin = window.open( url, name, "width=" + width + ",height=" + height + "," + options );
newWin.focus();
}


Then on the html page that opens up with the picture I have a close window:

a href="javascript:window.close()"

Now I know Paavo has mentioned a script that will open a window without having to create a new html document. That would be useful to start out with rather than my labor intensive method.
Reply with Quote Reply
Mar 17th 2003#95736 Report
Member since: Mar 24th 2002
Posts: 3114
Oh.
I have it automated with PHP, so all that is needed is to upload the images and thumbs into a folder called "gallery".
The full images are saved as a .jpg, and the thumbs as in
th_fullimagename.gif.

The source in it's whole:
[PHP]
echo "



Gallery

(under construction)




";

$dir="gallery";
$dp=opendir($dir);
while($file=readdir($dp)){if(strchr($file,"jpg")){$kuva[]=$file;}}
closedir($dp);
$egg=0;

for($i=0;$i$egg++;
if($egg>=6){$row="
";$egg=0;}
else{$row="";}
$kuva[$i]=str_replace(".jpg","",$kuva[$i]);

$info=getimagesize("gallery/".$kuva[$i].".jpg");
$height=$info[1];
$width=$info[0];



echo "$row\n";
}
echo "

href=\"#\"onClick=newwin=window.open('','','height=$height,width=$width,top=10,left=10');uusiikkuna('$kuva[$i]')>
$kuva[$i]

";
echo "
This is the astudios gallery.

After the \"meltdown\" of the old server, I haven't had time to upload all
the images I had on the old site.


It's pure hell to go through ones hard drive, and try to find every damn
image made. x|


Anywhoo, click on a thumbnail to view the image, and click the image to
close its window.


Click for<br />faked cars



Click for photoshop-graffiti





Click for astudios \nconcept car<br />designs

";
echo "
";

[/PHP]

Reply with Quote Reply
Mar 17th 2003#95749 Report
Member since: Mar 18th 2001
Posts: 6632
I also posted a link in the resources forum that does what you are talking about. It's under the cool scripts section.
Reply with Quote Reply
Mar 17th 2003#95752 Report
Member since: Nov 26th 2001
Posts: 2586
Paavo you are "da man"
Reply with Quote Reply
Mar 17th 2003#95770 Report
Member since: Sep 16th 2002
Posts: 1876
Wow, thanks guys!

However, now, it looks like I'm gonna have to switch hosts, damn homestead doesn't support php. :(
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum