【问题标题】:How can I simulate typing text? Javascript/jQuery, vextab如何模拟输入文本? Javascript/jQuery, vextab
【发布时间】:2020-12-20 21:38:39
【问题描述】:

我正在使用一个名为 vextab 的 javascript 包。 https://github.com/0xfe/vextab 该软件包使在 javascript 中创建吉他标签变得容易。 参考这个jsfiddle:https://jsfiddle.net/hy8efjg4/

包根据 div 属性和内容加载选项卡 svg。 我希望能够更改 div 的内容以呈现新的选项卡 svg。 我该怎么做?

<div class="vextab-auto"
    width=680 scale=1.0 editor="true"
    editor-width=680 editor-height=330>
    options space=20
    tabstave notation=true key=A time=4/4

    notes :q =|: (5/2.5/3.7/4) :8 7-5h6/3 ^3^ 5h6-7/5 ^3^ :q 7V/4 |
    notes :8 t12p7/4 s5s3/4 :8 3s:16:5-7/5 :h p5/4
    text :w, |#segno, ,|, :hd, , #tr

    options space=25
</div>

# javascript

scratch_tab = "options space=40 font-size=14\n" +
                  "tabstave notation=true key=A\n" +
                  "notes :q (5/2.5/3.7/4) $A7#9$ 15h16/1 20/1"

$('.editor').val(scratch_tab);
$('.editor').keyup();

那个键显示即使触发键也无济于事。

【问题讨论】:

标签: javascript html jquery svg


【解决方案1】:

使用 API 来达到预期的效果(他们的原生 js 包,而不是浏览器——但它仍然可以在浏览器中工作)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-10
    • 2020-10-04
    • 2011-07-06
    • 1970-01-01
    • 2012-12-06
    • 2020-09-02
    • 1970-01-01
    相关资源
    最近更新 更多