我试着让 typist.js 工作,但我遇到了困难,因为它似乎什么也没做。以下是我为使其正常工作所采取的步骤。
https://github.com/positionly/Typist
javascript 文件夹中的 typist.js
application.js
//= require typist
show.html.erb
JavaScript is <strong id="typist-element" data-typist="ugly,not as good an CoffeeScript">great</strong>
applications.css
.selectedText {
background: #f00;
}
但是什么也没发生,它什么也没做。我如何让它工作?
最佳答案
如文档中所述,您必须运行 javascript。在 CoffeeScript 中:
typist = document.querySelector "#typist-element"
新打字员打字员,
字母间隔:60
文本间隔:3000
关于javascript - Rails : I'm having issues with javascript and rails. 如何让 typist.js 工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31482906/