demo.html 959 Bytes
<div id="html" class="page out" data-title="富文本插件">
	<div id="richtext-header"></div>
	<div id="richtext-a"></div>
</div>
<script>
require(["NavHeader", "RichText"], function(NavHeader, RichText) {
	var _u = require("mUtil");
	var hasClsPicker = typeof clsPicker !== "undefined";
	if(!hasClsPicker) {
		new NavHeader({
			el: "richtext-header",
			option: {
				title:"富文本插件",
				smallTitle:"RichText"
			}
		}).render();
	}
	new RichText({
		el: "richtext-a",
		option: {
			text: '<span style="color:#2980b9"><span style="font-size:22px"><span style="font-family:Courier New,Courier,monospace">Hello world!</span></span></span><br />' +
                '<span style="font-size:20px"><span style="font-family:KaiTi"><span style="background-color:#c0392b">大家好,这是一个富文本编辑器。</span></span></span>'
		}
	}).render().then(function(){
		if (!hasClsPicker) return;
		_u.vetically("#richtext-a");
	});
});
</script>