2013-02-02 52 views
-1

我想從http://kiro.me/projects/textualizer.html使用js textualizer,但它不適合我,我有一個js小提琴去我想知道如果有人可以弄清楚這一點。試圖實現js textualizer

http://jsfiddle.net/Zk2tr/2/

代碼

HTML

<script src="https://raw.github.com/krisk/textualizer/master/textualizer.min.js"></script> 
<div id="output"></div> 
Not Working 

JS

var list = ['first blurb', 'second blurb', 'third blurb']; // list of blurbs 

var txt = $('#output'); // The container in which to render the list 

var options = { 
    duration: 1000,   // Time (ms) each blurb will remain on screen 
    rearrangeDuration: 1000, // 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(list, options); // textualize it! 
txt.textualizer('start'); // start 

回答

1

試試這個例子:

http://jsfiddle.net/Zk2tr/9/

爲了使其正常工作,您需要添加一些初始樣式。例如:

#output { 
    font-size: 40px; 
    height: 200px; 
    margin-top: 50px; 
    padding: 10px; 
    text-align: center; 
    border: 1px solid gray; 
} 
+0

非常感謝你 –