Diễn Đàn Hỗ Trợ Forumvi :: Share & Support Fourumvi :: Code[Code] Thêm nhiều font chữ cho trình soạn thảo
[Code] Thêm nhiều font chữ cho trình soạn thảo
Trang 1 trong tổng số 1 trang • Share
[Code] Thêm nhiều font chữ cho trình soạn thảo
Demo:
[You must be registered and logged in to see this link.]Hướng dẫn:
1. Tạo 1 trang JS(Javascript) mới
Titile: Add more fonts in editorPlace: In all the pages
- Code:
$(function(){$(function() {
$('.sceditor-button-font').click(function() {
addFont('Calibri');
addFont('Papyrus');
addFont('Copperplate');
addFont('Avantgarde');
$('.sceditor-font-option.new-font').click(function(e){$('#text_editor_textarea').sceditor('instance').insertText('[font='+$(this).attr('data-font')+']','[/font]');$('.sceditor-font-picker').remove();e.preventDefault()})
});
function addFont(font){$('.sceditor-font-picker div').append('<a unselectable="on" class="sceditor-font-option new-font" href="#" data-font="'+font+'"><font unselectable="on" face="'+font+'">'+font+'</font></a>')}
})});
2. Các thêm font mới:
Muốn thêm font mới các bạn chỉ cần thêm một đoạn này vào là OKVí dụ mình muốn thêm font Baskerville thì chỉ cần thêm đoạn này:
- Code:
addFont('Baskerville');
- Code:
addFont('Calibri');
addFont('Papyrus');
addFont('Copperplate');
addFont('Avantgarde');
là được
HelpsFMvi- Ban Quản Trị FMvi
- Số bài : 104
HelpsPoints : 15528
Likes : 33
Ngày tham gia : 10/03/2016
Trạng thái :Online Offline
Tuổi : 26
Location : Ninh Thuận
[Click để xem tài sản HelpsFMvi]
Similar topics
» [Code] Nút phóng to & thu nhỏ khung soạn thảo
» [Code] Menu dọc cho phbb2
» [Code] Màu Cho Các Thẻ Code
» [Code] Nút lên đầu trang
» [Code] Nút like và dislike
» [Code] Menu dọc cho phbb2
» [Code] Màu Cho Các Thẻ Code
» [Code] Nút lên đầu trang
» [Code] Nút like và dislike
Trang 1 trong tổng số 1 trang
Diễn Đàn Hỗ Trợ Forumvi :: Share & Support Fourumvi :: Code[Code] Thêm nhiều font chữ cho trình soạn thảo
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|