我使用一个名为 Textualizer 的 jQuery 插件,我想通过 HTML 表单向它添加数据。
继承人的代码:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="textualizer.min.js"></script>
</head>
<style type="text/css">
#txtlzr{color:#585856; font-size:50px; width:1200px; height:100px;
margin-left:10%;
margin-top:80px;
font-family:"futura";
position: fixed;
}
</style>
<body>
<div id="txtlzr"></div>
<form action="#" method="post"/>
<input class="kwote" type="text" maxlength="40" id="kwote" placeholder="Enter a something here."/>
<input class="name" type="text" maxlength="17" id="name" placeholder="Enter your name."/>
<input class="post" type="submit" value="Post"/>
</form>
</body>
<script>
var stuff1 = ['"random comment-person1', '"random comment"- person2']; // list of blurbs
var txt = $('#txtlzr'); // The container in which to render the list
var options = {
duration: 5, // Time (ms) each blurb will remain on screen
rearrangeDuration: 5, // Time (ms) a character takes to reach its position
effect: 'random', // Animation effect the characters use to appear
centered: true // Centers the text relative to its container
}
txt.textualizer(stuff1); // textualize it!
txt.textualizer('start'); // start
</script>
</html>
这是完整的代码,只要您链接了 jquery 和 textualizer 文件或在包含 html 的目录中,它就可以工作。
文本化器:http: //kiro.me/textualizer/javascript/textualizer.min.js