html可视化数学公式编辑,所见即所得的jQuery数学公式编辑器插件
MathquillBasedEditor是一款所見(jiàn)即所得的jQuery數(shù)學(xué)公式編輯器插件。該數(shù)學(xué)公式編輯器依賴于mathquill,可以通過(guò)點(diǎn)擊圖標(biāo)來(lái)直接生成乘方和開(kāi)方等數(shù)學(xué)公式。
使用方法
在頁(yè)面中引入mathquill和matheditor的相關(guān)文件。
HTML結(jié)構(gòu)
使用一個(gè)
作為公式編輯器的容器。初始化插件
可以通過(guò)下面的方法來(lái)實(shí)例化MathEditor對(duì)象。
var mathEditor = new MathEditor('some_id');
mathEditor.buttons(["fraction","square_root","cube_root","root",'superscript','subscript']);
// If you dont write this line editor will display default buttons.
mathEditor.removeButtons(["fraction","square_root"])
// If you want to remove some buttons from default list.
mathEditor.styleMe({
width: '500',
height: '80'
});
// List of other options are mentioned bellow.
mathEditor.setTemplate('keypad');
// It will make button toolbar look like keypad.
// More options would be added.
mathEditor.getValue();
// It will return letex for input formula.
配置參數(shù)
在styleMe()方法中可用的配置參數(shù)如下:
參數(shù)
類型
默認(rèn)值
描述
width
string
500
編輯器的最小寬度。
height
string
40
編輯器的最小高度。
textarea_background
string
#FFFFFF
編輯器文本區(qū)域的背景顏色。
textarea_foreground
string
#000000
編輯器文本區(qū)域的前景顏色。
textarea_border
string
#000000
編輯器文本區(qū)域的邊框顏色。
toolbar_background
string
#FFFFFF
編輯器工具欄的背景顏色。
toolbar_foreground
string
#000000
編輯器工具欄的文本顏色。
toolbar_border
string
#000000
編輯器工具欄的邊框顏色。
button_background
string
#FFFFFF
編輯器工具欄按鈕的背景顏色。
button_border
string
#000000
編輯器工具欄按鈕的邊框顏色。
總結(jié)
以上是生活随笔為你收集整理的html可视化数学公式编辑,所见即所得的jQuery数学公式编辑器插件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 实验四+087+饶慧敏
- 下一篇: SEO必备的利器–iMacros