将DIV转换为单击并拖动视口 [英] Turning a DIV into a click-and-drag viewport

查看:115
本文介绍了将DIV转换为单击并拖动视口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一个不引人注目的,原型或没有框架的方式将大内容(例如地图)转换为可点击和可拖动的地图容器与固定尺寸,非常像谷歌地图?

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?

我想以大的输入形式显示HTML块。这些块可以超过可用的空间(每个块可以具有约150×300像素的视口)。点击拖动解决方案将是完美的移动通过他们。我可以使用overflow:auto当然,但这不是一个方便的方法移动在这种情况下。

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.

推荐答案

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

它可能指向正确的方向至少

It may point you in the right direction at least

这篇关于将DIV转换为单击并拖动视口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆