Forgot password?
 Create new account
View 152|Reply 0

编辑器添加字体

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2023-5-11 01:07:17 |Read mode
建议编辑器在字体列表添加按钮➕
用户点击➕就可以添加他常用的字体
  1. function addFont(font){let el=document.createElement('li');el.setAttribute('onclick',`discuzcode('fontname', '${font}')`);el.style=`font-family:${font}`;el.innerHTML=`<a href="javascript:;" title="${font}">${font}</a>`;$('e_fontname_menu').firstElementChild.prepend(el)}
Copy the Code

例如addFont('Garamond')
Screenshot 2023-05-10 at 18-11-33 编辑帖子 - 编辑器添加字体 - 站务管理 - 悠闲数.png

手机版Mobile version|Leisure Math Forum

2025-4-20 22:08 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list