Open new window sized for image when clicking on Thumbnail

CarpetBagger
CarpetBagger's picture

Joined: 2002-08-09
Posts: 49
Posted: Tue, 2002-08-20 15:35

When a user clicks on a thumbnail, why not use JavaScript to open a new window. You could open it without the Buttons, Menu or status bar and size the window to fit the scaled view specified in the album definition. You would then have more space for the image to display. This might be expecially helpful in an embedded setup like Post/PHPNuke. Include code so that when the image is left clicked on again, it closes the window. You might even allow a configuration option to prevent right-clicking in the opened window.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2002-08-20 16:50

In G2, that kind of functionality will be part of the layout code. Hopefully, it'll be fairly easy for folks to write all kinds of new layouts. I'm envisioning a layout library where you can download and use layouts that others have written.

 
praccus

Joined: 2004-02-02
Posts: 1
Posted: Thu, 2004-02-05 02:13

Sounds cool. One thing I think would be really nice for usabilty is for the indiv photo popups to have a prev / next menu to them, so that people can just click through the images in the popup window. I guess you'd have the issue of different sized images within the same sized popup window. If it was done inline with image being sized to a specific max width and height then it would rock...

 
Jscripts

Joined: 2004-01-28
Posts: 16
Posted: Thu, 2004-02-05 11:25

I know a fair bit about Javascript, so I'll give you some info as best I can...

Once a window is opened by "your" url (in other words, opened by a Javascript call) it is easy to RESIZE it dynamically - for example : self.resizeTo(800,600) or OtherWindowName.resizeTo(800,600). This resizes the window's OUTER dimensions to whatever is specified (in prev case 800x600).

One BIG problem is that many browsers don't actually IMPLIMENT popups - Opera is a perfect example, it is a tabbed browser. Therefore, they don't have the ability to "resize" anything (or even open a page in a new window as-such)

Furthermore, browsers that DO open a new window (IE, Moz, NS, etc) all have different sized "chrome" (borders, menu areas etc) around the client area (where the image actually displays) - esp between different OS, and also you can also actually vary the border sizes in Windows Control panel too !

So, take a popup window to display a 800 x 600 pic within - there has to be some fairly elaborate browser detection, then a different OUTER size (what resizeTo() actually changes) for each browser/OS ! It's not really THAT hard to code something that works (IE is difficult, whilst old NS4 is EASY for once) but overall it's a major PITA and not scaleable for future browsers. I was also under the impression that macs can't resize at all...

So, whilst it is possible to make such a script work for MOST browsers, it's impossible to impliment for all browsers. Overall, it's probably easier to fit the image to the window than visa-versa - which is precisely what the Gallery "fit-to-window" attempts to do (except it doesn't actually work).

As for the idea of Prev/Next in the popup, that would be possible but as praccus says the constant resizing of the window would look awful (and make it hard to navidgate as the buttons would just around each time).

One thing to remember is that Gallery resizes images automatically - by careful setting of the image dimensions inside config, it's possible to have all images (of the same orientation) be the same size. Therefore, there is no need to have image resizing "inline" - it's already been done !

Not trying to be negative, just my 2c worth

J