CKeditor 是一个非常好用的web编辑器,javaEye 上也又很多介绍,有兴趣的同学可以继续围观: http://ckeditor.com/
这里主要讲如何定制 ckeditor 的toolbar,以及让 ckeditor 和 jQuery 协同工作。
1. 在确保 jQuery 能正常工作后,引入 ckeditor, 在 <head> 区添加。
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/adapters/jquery.js"></script>
2. At this point, any textarea, p or div element can be transformed into a rich text editor by simply using the ckeditor() method:
$( 'textarea.editor' ).ckeditor();
3. 定制 toolbar。
<script>
$(document).ready(function(){
//customize ckeditor toolbar.
var config = {
toolbar:
[
['Source','Preview','-','Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','TextColor','BGColor'],
['UIColor','-','Image']
]
};
//fire ckeditor
$("#text").ckeditor(config);
});
</script>
定制后的 toolbar 如下图:
References:
http://ckeditor.com/blog/CKEditor_for_jQuery
CKEditor Toolbar: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar
- 大小: 6.8 KB
分享到:
相关推荐
Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques ...
This fully updated and expanded guide takes you step-by-step through JavaScript basics, then shows you how to save time and effort with jQuery—the library of prewritten JavaScript code—and the ...
build different versions of programs for different platforms, and customize your builds in other ways.This edition focuses on the GNU version of make, which has deservedly become the industry ...
Finally, using the various Python libraries, this book will arm you with knowledge to customize data solutions and generate reports to meet your business needs. This book will help you up-skill and ...
With Make an Arduino Controlled Robot, you’ll learn how to build and customize smart robots on wheels. You will: Explore robotics concepts like movement, obstacle detection, sensors, and remote ...
implementation and then see how easy it is to customize its appearance and configure its behavior to tailor it to the requirements of your application. You'll look at the configuration options and ...
- Customize your robot with LEDs and speakers to make it light up and play sounds - See what your robot sees with a Pi Camera As you work through the book, you'll learn fundamental electronics skills...
Build, develop, and customize your application using Angular.js and Bootstrap Packed with tips to help you avoid potential stumbling blocks while developing Book Description Two of the most popular ...
CKEditor-Widget-自定义 CKEditor小部件+拖放集成
If you’re an experienced programmer familiar with GitHub, you’ll learn how to build tools with the GitHub API and related open source technologies such as Jekyll (site builder), Hubot (NodeJS chat ...
Finally, you will learn how to use analytics to track project expenses and keep your accounts simple and easy to maintain and build an Odoo module to extend its functionality and make it work for you...
An indicator view providing you more freedom to control and customize it.zip,An indicator view providing you more freedom to control and customize it.一个魔性的菊花控件,助你摆脱系统菊花的各种烦恼
You'll learn how the Pi works, how to work with Raspbian Linux on the Pi, and how to design and create electronic circuits. You'll then create projects like an arcade game, disco lights, and infrared...
The book will also help you set up unit and integration testing with different libraries and will show how Gradle and Android Studio can make running tests easier. Finally, you will be shown a number...
including virt-manager, and kimchi-project, everything you do is built around making KVM work for you in the real-world, helping you to interact and customize it as you need it. With further guidance...
Work with encapsulation, abstraction, and polymorphism using Swift 2.0 Customize constructors and destructors based on your needs Develop Swift 2.0 with classes, instances, properties, and methods ...
Move beyond default UI templates, create and customize amazing UIs with Android Custom View Enable smooth data flow and create futuristic UIs by creating flexible custom views Scale your apps with ...
该插件允许用户完全自定义 Notepad++ 工具栏。 它包括用于常用菜单命令的 26 个附加按钮。 工具栏上的所有按钮都可以自定义,无论是 Notepad++ 按钮、附加按钮还是其他插件按钮。 Notepad++ 菜单命令或其他插件菜单...
It starts by helping you to recognize objects from real-life scenarios and demonstrates that working with them makes it simpler to write code that is easy to understand and reuse. You will learn to ...
Getting Started with OpenCart Module Development gives you step-by-step explanations and illustrations on how to clone, customize, and develop modules and pages with OpenCart. This book shows you how...