Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用jwysiwyg,我希望能够以编程方式单击一些工具栏按钮,例如粗体、斜体等。这可能吗?
基本上,我想要这样的东西:
$('#editor').wysiwyg('click', 'bold');
试试$('#editor .toolbar .bold').click()。这不是绝地的方式,但它可以正常工作。
$('#editor .toolbar .bold').click()
UPD
在快速查看所见即所得资源之后,我认为这是唯一正确的方法。
正确的答案是$('#editor-textarea').data('wysiwyg').triggerControl('bold',{});
$('#editor-textarea').data('wysiwyg').triggerControl('bold',{});