2012-03-19 63 views

回答

5

创建以下HTML结构以将输入框放在画布上。

<div id="container" style="width:500px; height:500px; position:relative;"> 
    <canvas id="drawing-surface" width="500px" height="500px"></canvas> 
    <input type="text" style="position:absolute; left=?; top=?;" /> 
</div> 

希望这可以解决您的问题。将left=?top=?替换为适当的位置。

+0

谢谢,如果我需要以编程方式移动输入? – user310291 2012-03-21 07:33:20

+0

假设你正在使用jQuery库,请执行此操作。 $('#input')。css({top:topPos,left:leftPos}); – 2012-03-22 15:02:23