SVG: How to click & drag ?

M

Martin

I have an application that generates a page with an embedded SVG image
in it. The image (the viewport) is intentionally larger than the
screen (the browser's window size). I would like to provide the
ability for the user to click on the image and drag it around so that
he can see the parts that are off-screen - much like he would use the
scroll bars to move it left/right and up/down.

Note that I am NOT talking about dragging a specific element around -
I want to be able to move the entire image without changing the image
in any way. Also, I'm NOT talking about drag-and-drop.

Can anyone tell me how this might be done? Or, perhaps point me to
some on-line examples?

Thanks.
 
M

Martin Honnen

Martin said:
I have an application that generates a page with an embedded SVG image
in it. The image (the viewport) is intentionally larger than the
screen (the browser's window size). I would like to provide the
ability for the user to click on the image and drag it around so that
he can see the parts that are off-screen - much like he would use the
scroll bars to move it left/right and up/down.

Note that I am NOT talking about dragging a specific element around -
I want to be able to move the entire image without changing the image
in any way. Also, I'm NOT talking about drag-and-drop.

It's called panning, I think the Adobe SVG viewer supports with
Control-Click.
 
M

Martin

It's called panning, I think the Adobe SVG viewer supports with
Control-Click.

Thanks, Martin.

Wow, that was easy - I don't have to program or script anything!

BTW, it's Alt-Click rather than Control-Click. Control-Click seems to
provide a zoom functionality.

The problem now is - this seems to work only in IE (with the Adobe
viewer); Alt-Click (or Control-Click) doesn't do anything in FF. Do
you know if there's any way to get similar behavior in FF?
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top