放大元素而不改变元素的大小

发布于 2024-12-17 06:57:09 字数 87 浏览 0 评论 0原文

例如;如果我有一个画布画布图,并且我希望能够查看其中一个区域的特写,我希望能够放大特定区域并显示一个滚动条以进行水平和垂直平移,以便可以查看每个部分。这可能吗?

For example; if I had a flot canvas graph and I wanted to be able to view a closeup of one of the areas, I want to be able to zoom into a specific area and have a scrollbar appear for horizontal and vertical panning so every section can be viewed. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天冷不及心凉 2024-12-24 06:57:09

您可能需要使用 zoom CSS 属性。这是它的一个小例子

至于滚动条,您可以尝试将缩放元素放置在设置了 overflow:scroll; 的父元素中。

我希望这有帮助。

You may want to use the zoom CSS property. Here is a little example of it in action.

As for the scroll bars, you could try placing the zoomed element within a parent which has overflow: scroll; set.

I hope this helps.

倾城月光淡如水﹏ 2024-12-24 06:57:09

一切皆有可能,但 flot 本身并不支持这一点。最好的选择是使用 flot 内置的平移和缩放功能(通过导航插件),但是对于滚动条,您可能必须覆盖一些假滚动条(可能使用带有 overflow:scroll,如@Wolfy87建议的那样)并将它们连接到flot图上。

当图形移动时,Flot 会触发 plotpanplotzoom 事件,因此您可以使用它们来保持滚动条同步。

我以前没见过有人这样做,所以我无法给你举一个例子。但代码放在一起似乎也不是不合理。

Anything is possible, but flot doesn't support that by itself. Your best bet would be to use the panning and zooming functions built into flot (via the navigate plugin), but then for the scrollbars, you might have to overlay some fake scrollbars (perhaps using a div with overflow:scroll, as @Wolfy87 suggested) and hook them up to the flot graph.

Flot triggers plotpan and plotzoom events when the graph has moved, so you would use them to keep your scrollbars in sync.

I haven't seen anyone do this before, so I can't point you towards an example. But the code doesn't seem unreasonable to put together.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文