Picture Poup

P

Possum

Hi

I have an arts site and have thumbnails that Need to show larger picture in
a popup window when clicked. Or opens another window that is not full screen
but is the roughly the same size as the picture being displayed..

how can I do this ..


Cheers Peter
 
B

Blinky the Shark

Possum wrote:

[stuff]

I read the Subject header and though this was going to be a thread on
photograph droppings. :)
 
M

mbstevens

Possum said:
Hi

I have an arts site and have thumbnails that Need to show larger picture in
a popup window when clicked. Or opens another window that is not full screen
but is the roughly the same size as the picture being displayed..

how can I do this ..


Cheers Peter
<a href="images/11.jpg"
onclick="window.open('images/11.jpg','flower_window','width=500,
height=406'); return false;">
<img src="images/1.jpg" width="50"
height="41" alt="flower" />
<p>(Image will open in a new window.)</p></a>

....but never, ever do it, or anything even
vaguely like it.
 
J

jojo

mbstevens said:
<a href="images/11.jpg"
onclick="window.open('images/11.jpg','flower_window','width=500,
height=406'); return false;">
<img src="images/1.jpg" width="50" height="41" alt="flower" />
<p>(Image will open in a new window.)</p></a>

...but never, ever do it, or anything even vaguely like it.

So why do you post it if you tell him not to use it just one line later?
 
A

Andy Dingley

mbstevens said:
<a href="images/11.jpg"
onclick="window.open('images/11.jpg','flower_window','width=500,
height=406'); return false;">
<img src="images/1.jpg" width="50"
height="41" alt="flower" />
<p>(Image will open in a new window.)</p></a>

...but never, ever do it, or anything even
vaguely like it.

Nothing wrong with most of that - you use href appropriately as a
fallback if the JavaScript event handler isn't available. It does the
right things with return values etc.

I would suggest though using <br> instead of <p> to keep the HTML
valid.

I'd also give a useful title as the caption beneath the image, not an
instruction to go clicking on things. If you need this, do it once per
page.

If the popup window is to have a size, then try to set this dynamically
based on the actual size of the image. You can do this either server or
client side.

I'd also use the target="imagepopup" attribute on the <a> so as to open
them in a new window (I know opinions vary on this, but IMHO it's a
good use of it).
 
M

mbstevens

Andy said:
Nothing wrong with most of that - you use href appropriately as a
fallback if the JavaScript event handler isn't available. It does the
right things with return values etc.

I would suggest though using <br> instead of <p> to keep the HTML
valid.
I did in my page about the thumbnailing that
I copied it from:
http://www.mbstevens.com/howtothumb

I saw the <br> on my page and thought, a <p>
would work better. I didn't remember my own
research!
I'd also give a useful title as the caption beneath the image, not an
instruction to go clicking on things. If you need this, do it once per
page.

That's not so much an instruction as a
warning that the thing will open a new
window. Visitors should be warned, at the
very least, if you are about to do something
so rude as opening a new window. Of course,
you shouldn't do it at all!
If the popup window is to have a size, then try to set this dynamically
based on the actual size of the image. You can do this either server or
client side.

Finding the size of images on the fly might
eat time. I think that this size should be
known in advance, either stored by the server
side program in a base or passed to the
server side program by the call from HTML.
For client side, you should just know the
size of the image in advance and code it in.
If it's on your site you can find it out in
advance easily.
 
M

mbstevens

jojo said:
mbstevens wrote:

So why do you post it if you tell him not to use it just one line later?

There is a difference between facts and the
ethical use of those facts. Facts should not
be hidden.
 
J

Jonathan N. Little

Nico said:
Interesting approach. Thanks for the link!

The down side is that the thumbnails are not thumbnails but the full
size images constrained. Would have very limited use because you would
need to limit the number on the page and|or keep the full size images
small...
 
A

Andy Dingley

mbstevens said:
Finding the size of images on the fly might
eat time.

Issues like that are for the implementor to sort out. A reasonable
server-side implementation has metadata like that already available to
it. A client-side implementation can find it easily, as the image will
need to be loaded anyway.
 
D

dorayme

...but never, ever do it, or anything even vaguely like it.

So why do you post it if you tell him not to use it just one line later?[/QUOTE]

.... because it is important that a fully decked out, all
shooting, all singing website maker should know how to be bad as
well as good...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top