基于SVG的文本输入字段 [英] SVG-based text input field
本文介绍了基于SVG的文本输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除 http:// www之外,有没有人看过任何文本输入字段的javascript实现.carto.net / papers / svg / gui / textbox / ?
推荐答案
有一个有趣的SVG节点叫做 foreignObject
,它允许您在SVG代码中放置HTML,flash等。请尝试以下方法:
There is an interesting SVG node called foreignObject
, which allows you to place HTML, flash, etc within your SVG code. Try the following:
<svg width="100%" height="500" xmlns="http://www.w3.org/2000/svg>
<foreignObject x="10" y="10" width="100" height="150">
<div xmlns="http://www.w3.org/1999/xhtml">
<input></input>
</div>
</foreignObject>
</svg>
编辑:已添加 xmlns
所以适用于IE。
added xmlns
so it works for IE.
这篇关于基于SVG的文本输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文