當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


jQWidgets jqxEditor localisation屬性用法及代碼示例


jQWidgets 是一個 JavaScript 框架,用於為 PC 和移動設備製作基於 Web 的應用程序。它是一個非常強大、優化、獨立於平台且得到廣泛支持的框架。 jqxEditor 用於表示 jQuery HTML 文本編輯器,可用於簡化 Web 內容創建,也可用作 HTML 文本區域的替代品。

本地化屬性用於設置或返回本地化屬性。即該屬性決定了 jqxEditor 的本地化。它接受一個對象值,默認值為“{“bold”:“Bold”,“italic”:“Italic”,“underline”:“Underline”,“format”:“Format Block”,“font”:“Font Name”,“size”:“Font Size”,“color”:“Text Color”、“background”:“Fill Color”、“left”:“Align Left”、“center”:“Align Center”、“right”:“Align Right”、“outdent”:“Indent Less”、“indent” :“Indent More”、“ul”:“Insert unordered list”、“ol”:“Insert ordered list”、“image”:“Insert image”、“link”:“Insert link”、“html”:“View source”,“clean”:“Remove Formatting”}”。

用法:

設置本土化屬性。

$('Selector').jqxEditor({ localisation : object });  

返回本土化屬性。

var localisation = $('Selector').jqxEditor('localisation');

鏈接文件:下載jQWidgets從鏈接。在 HTML 文件中,找到下載文件夾中的腳本文件:

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxlistbox.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdropdownlist.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdropdownbutton.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcolorpicker.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxwindow.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxeditor.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxtooltip.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcheckbox.js”></script>

下麵的示例說明了 jQWidgets 中的 jqxEditor 本地化屬性:

例子:

HTML


<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <link rel="stylesheet" 
          href="jqwidgets/styles/jqx.base.css"
          type="text/css" /> 
    <script type="text/javascript" 
            src="scripts/jquery-1.11.1.min.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxbuttons.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxscrollbar.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxlistbox.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxdropdownlist.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxdropdownbutton.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxcolorpicker.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxwindow.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxeditor.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxtooltip.js"> 
      </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxcheckbox.js"> 
      </script> 
</head> 
    
<body> 
    <center> 
        <h1 style="color: green;"> 
              GeeksforGeeks 
          </h1> 
        
        <h3>jQWidgets jqxEditor localization Property</h3> 
        <textarea id="editor"> 
        </textarea> 
    </center> 
  
    <script type="text/javascript"> 
        $(document).ready(function () { 
            $('#editor').jqxEditor({ 
                height: "400px", 
                width: '700px', 
                localization: { 
                    "bold": "Fett", 
                    "italic": "Kursiv", 
                    "underline": "Unterstreichen", 
                } 
            }); 
        }); 
    </script> 
      
</body> 
</html>

輸出:

參考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxeditor/jquery-editor-api.htm



相關用法


注:本文由純淨天空篩選整理自taran910大神的英文原創作品 jQWidgets jqxEditor localisation Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。