jquery.qeditor——輕量級文字編輯器

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   os   ar   使用   java   

一、jquery.qeditor簡介 1、連結地址
  • :項目git地址
  • :中文版介紹
  • :測試Demo
2、其他富文字編輯器的優缺點

首先,正如你在找的很多富文字編輯器,功能有很多,也很複雜,但是很多功能根本用不到,儘管很多編輯器提供選擇功能的功能,但又介面不好看,或者載入較慢,代碼較多

其次,很多編輯器調用麻煩,編輯的內容有太多的style標籤,影響布局。

3.jquery.qeditor編輯器功能介紹

1.介面乾淨整潔,非常適合於小部落格或功能排版功能較少的頁面

2.所有產生的標籤都是html的標準標籤,沒有css的樣式,保持了代碼的整潔

3.自動根據一個 textarea 綁定,讓編輯器無縫的和 form 結合

4.使用 Font-awsome 作為 Toolbar 的按鈕表徵圖,使用簡單,並且支援 Retina Display

5.沈浸式的全屏介面,讓你在全屏介面找到真實預覽的感覺(這個真心推薦)

4.個人認為jquery.qeditor的小小不足

1.相容性略有不足,其作者並沒有測試IE,但是我試了試,在IE9(包括)以下都不可以使用

2.沒有顏色的設定及字型的設定(其實為了保持內容及代碼的乾淨,這些可以沒有)

二、使用jquery.qeditor

jquery.qeditor的使用很簡單,這裡做一個簡單的樣本與說明,可以下載其git上的demo,在本地就行測試

1、引入檔案

該編輯器是基於jquery的,表徵圖是基於Font-awsome,此外,還要引入必須的一個js和css檔案,如下:

<!DOCTYPE html><html><head>      <meta charset=utf-8">      <title>jquery.qeditor</title>      <link href="//libs.baidu.com/fontawesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">      <link rel="stylesheet" href="css/jquery.qeditor.css" type="text/css">      <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>      <script src="js/jquery.qeditor.js" type="text/javascript"></script></head><body>    <textarea id="post_body" name="body" class="textarea" placeholder="Type your post"></textarea>    <script type="text/javascript">            $("#post_body").qeditor({});    </script></body></html>

基本的格式便是如此,如果想讓邊界好看點,還可以自己寫一點點的css,如下:

2、加點樣式
<style type="text/css" media="screen">  .textarea {        background-color: #ffffff;        border: 1px solid #cccccc;        -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);        -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);        -webkit-transition: border linear .2s, box-shadow linear .2s;        -moz-transition: border linear .2s, box-shadow linear .2s;        -o-transition: border linear .2s, box-shadow linear .2s;        transition: border linear .2s, box-shadow linear .2s;        padding: 4px 6px;        font-size: 14px;        line-height: 20px;        color: #555555;        -webkit-border-radius: 4px;        -moz-border-radius: 4px;        border-radius: 4px;        vertical-align: middle;        outline: none;        height: 400px;  }  </style>

jquery.qeditor——輕量級文字編輯器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.