SVG: How to click & drag ?

Discussion in 'XML' started by Martin, Mar 18, 2008.

  1. Martin

    Martin Guest

    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.
     
    Martin, Mar 18, 2008
    #1
    1. Advertising

  2. Martin wrote:
    > 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.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 18, 2008
    #2
    1. Advertising

  3. Martin

    Martin Guest

    On Tue, 18 Mar 2008 17:01:05 +0100, Martin Honnen <>
    wrote:

    >Martin wrote:
    >> 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.


    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?
     
    Martin, Mar 18, 2008
    #3
  4. Martin wrote:

    > 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?


    The bug is https://bugzilla.mozilla.org/show_bug.cgi?id=163068, it looks
    like they are still debating on how to expose that functionality.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 18, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    531
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    810
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    669
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    833
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    475
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page