<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深蓝的blog &#187; H5编辑器</title>
	<atom:link href="http://www.lanxinbase.com/?feed=rss2&#038;tag=h5%E7%BC%96%E8%BE%91%E5%99%A8" rel="self" type="application/rss+xml" />
	<link>http://www.lanxinbase.com</link>
	<description>记录日常生活</description>
	<lastBuildDate>Sat, 18 Apr 2026 07:10:07 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.3</generator>
	<item>
		<title>H5设计一个简单的在线编辑器</title>
		<link>http://www.lanxinbase.com/?p=1648</link>
		<comments>http://www.lanxinbase.com/?p=1648#comments</comments>
		<pubDate>Fri, 21 Apr 2017 02:45:12 +0000</pubDate>
		<dc:creator><![CDATA[Alan]]></dc:creator>
				<category><![CDATA[6.前端开发]]></category>
		<category><![CDATA[H5编辑器]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[简单的编辑器]]></category>
		<category><![CDATA[编辑器]]></category>

		<guid isPermaLink="false">http://www.lanxinbase.com/?p=1648</guid>
		<description><![CDATA[上面的代码，就是编辑器的代码，把对象直接绑定到window对象中，方便调用；

接下来，就是实现了，首先我们需要一个DOM对象来绑定编辑器：

\<\div class=\"contentEditable\"\>\<\/div\>
自己新建了一个div，这里最好使用ID，本人是测试，所以懒；

然后调用编辑器对象的init方法，初始化编辑器；

editorUtils.init(document.getElementsByClassName(\"contentEditable\")[0]);
init的方法，主要是设置编辑器的高度宽度，已经class样式，继承绑定对象的属性，我只写了一个class绑定，之后就把绑定对象隐藏起来；

然后大功告成了，现在可以编辑内容了，我们来看一下截图：]]></description>
		<wfw:commentRss>http://www.lanxinbase.com/?feed=rss2&#038;p=1648</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
