如何获取SVG中的ScrollBar以获取多个内容 [英] How to gets ScrollBars in SVG for multiple content

查看:80
本文介绍了如何获取SVG中的ScrollBar以获取多个内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个包含四个SVG内容的容器SVG.现在,这四个SVG内容的内容超出了容器SVG中分配给它们的区域所容纳的内容,因此我要求滚动条自动显示,以便用户可以通过滚动看到完整的svg内容.

I want to have a container SVG which contain four SVG contents. Now these four SVG content has more content than can fit in the area allocated to them within the container SVG, hence I require that scrollbars appear automatically so that the full svg content can be seen by the user by scrolling.

我尝试通过添加属性width和height建立新的视口,但是没有出现滚动条.我什至尝试将溢出属性与scroll和auto值一起使用,但仍然不会出现滚动条.

I have tried establishing new viewports by adding the attributes width and height but scroll bars do not appear. I even tried using the overflow property with values of scroll and auto but still scrollbars do not appear.

该问题的正确解决方法是什么?

What is the correct solution to this problem ?

推荐答案

目前的答案是,您需要提供自己的平移/滚动功能,无法将svg内的滚动条与可能的包装分开通过foreignObject(可能是次优)在另一个html容器中.

At the moment the answer is that you need to provide your own panning/scrolling functions, there's no way to get scrollbars inside of the svg apart from possibly wrapping it inside another html container via foreignObject (which would likely be suboptimal).

以下是一些可帮助您开始使用自定义svg滚动条的资源:

Here are some resources to get you started with custom svg scrollbars:

  • http://www.carto.net/papers/svg/gui/scrollbar/
  • http://www.treebuilder.de/default.asp?file=67211.xml
  • http://www.dotuscomus.com/svg/lib/library.html

这篇关于如何获取SVG中的ScrollBar以获取多个内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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