views:

138

answers:

3

Does somebody know an unobtrusive, Prototype or no framework based way to turn a DIV with big content (e.g. a map) into a clickable and draggable "map" container with fixed dimensions, very much like Google Maps?

I want to display HTML chunks in a large input form. Those chunks can exceed the space available (Each chunk can have a viewport of about 150x300 Pixels). A click-and-drag solution would be perfect to move through them. I could use overflow:auto of course but that is not a convenient method to move around in this case.

+1  A: 

Are you after something like jQuery portlets?

Ben Fransen
No, I am not looking to drag the divs, but to scroll through a DIV dragging and moving my mouse, very much like you move around in Google Maps.
Pekka
Ah now I understand what you are looking for. I googled arround a bit but i couldn't come up with something worthfull to you. Maybe tonight I'll give it a shot again.
Ben Fransen
A: 

I make one for a touch-screen kiosk. It involves moving a large map based on someone dragging the viewable area on a mini-map, with various zoom levels.

Take a look:

http://www.mintohomes.com/morgansgrantkiosk/SitePlan/Default.asp

The JavaScript source is in the page.

Diodeus
This is interesting, however I am looking for a solution for one viewport only, not two. But I'll take a look and maybe I can derive something from the code. Thanks.
Pekka
+1  A: 

Have a look at the following:

http://www.switchonthecode.com/tutorials/javascript-tutorial-draggable-view-in-a-container

It may point you in the right direction at least

Katy
That's exactly what I'm looking for. Thanks!
Pekka