当用户在文本框中键入时,如何在图像上显示文本



下面是这个例子:http://www.potterybarn.com/products/saddle-stitch-leather-luggage-tag/?catalogId=69&cm_src=AutoRel

当用户在"查看您的个性化设置在此项目上的外观"中键入一些文本时。指定文本:'并按预览,而不是该文本出现在具有某些特定字体样式 n all 的图像上。所以问题是如何做到这一点?这是一个JavaScript吗?如果是,那么我应该从哪里得到这个?

然后从中获取想法

<html>
<head>
<script>
function preview()
{
document.getElementById("txt").innerHTML=document.getElementById("person").value;
}</script></head>
<body>
<div style="position:relative;">
<img src="whatever"><span id="txt" style="font:20px Tahoma;position:absolute;top:0px;left:0px;"></span>
</div>
<label for="person">See how your personalization would look on this item. Specify text:</label><input type="text" id="person" >
<button onclick="preview()">Preview</button></body></html>

最新更新