Forum Moderators: open
I don't know Javascript well at all. Thought I'd establish that first ;)
I'm working on a project where thumbnails are generated on a page, and when they're clicked on, the full version comes up in a Javascript opo-up window. This is database driven.
The pictures that come up as full size are quite large, and I'd like to keep the the original size. Problem is, at lower resolutions the pop-up window is so large that it doesn't fit on screen.
My question is this: is there a way, with php and/or Javascript to have the script detect the user's resolution and resize the pop-up accordingly, which would automatically resize the pic inside it?
Because this is database-driven I don't want to make several different-sized versions of the pic to accomodate this issue.
Any Ideas?
Thank you for your time,
-Elise
I do reckon though, that rather than resizing the window, you might as well open it at the correct size to start with:
window.open("","_source_","width=nn,height=hh, etc ")
..but now I've thought about it, I see what Joe's at. Until you get the image, you don't know what size it is. Thing is, as a USER, I find pop-ups irritating enough without them rearranging themselves once they've opened.
The answer here is to store the dimensions of the images, perhaps in a JavaScript array.
Just an idea: Do you need to open a window at all?
To reduce the irritation factor, you could create a draggable DIV instead.
oh, and if you call window.resize( ) from the opening window, it'll resize that instead. (Just thought I'd mention!)