<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[W3C标准WEB前端DHTML精英俱乐部]]></title>
<link>http://www.v-ec.com/dh20156/</link>
<description><![CDATA[Javascript和CSS权威专家WEB前端开发指南]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[dh20156@126.com(风之石)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>W3C标准WEB前端DHTML精英俱乐部</title>
	<url>http://www.v-ec.com/dh20156/images/logos.gif</url>
	<link>http://www.v-ec.com/dh20156/</link>
	<description>W3C标准WEB前端DHTML精英俱乐部</description>
</image>

			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=289</link>
			<title><![CDATA[加速Javascript：DOM操作优化]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Mon,08 Mar 2010 17:11:48 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=289</guid>
		<description><![CDATA[<p>原文：《Speeding up JavaScript: Working with the DOM》</p>
<p>作者： KeeKim Heng, Google Web Developer</p>
<p>翻译：http://www.blogjava.net/emu/archive/2010/03/01/314185.html</p>
<p>在我们开发互联网富应用（RIA）时，我们经常写一些javascript脚本来修改或者增加页面元素，这些工作最终是DOM&mdash;&mdash;或者说文档对象模 型&mdash;&mdash;来完成的，而我们的实现方式会影响到应用的响应速度。</p>
<p>DOM操作会导致浏览器重解析(reflow)，这是浏览器的一个决定页面元素如何展现的计算过程。直接修改DOM，修改元素的CSS样式，修改浏 览器的窗口大小，都会触发重解析。读取元素的布局属性比如offsetHeithe或者offsetWidth也会触发重解析。重解析需要花费计算时间， 因此重解析触发的越少，应用就会越快。</p>
<p>DOM操作通常要不就是修改已经存在的页面上的元素，要不就是创建新的页面元素。下面的4种优化方案覆盖了修改和创建DOM节点两种方式，帮助你减 少触发浏览器重解析的次数。<br />
</p>
<p><span style="font-size: 18pt;"><strong>方案一：通过CSS类名切换来修改DOM</strong></span>&nbsp;</p>
<p>这个方案让我们可以一次性修改一个元素和它的子元素的多个样式属性而只触发一次重解析。</p>
<p>需求：</p>
<p>（emu注：原文作者写到这里的时候脑子显然短路了一下，把后面的Out-of-the-flow DOM  Manipulation模式要解决的问题给摆到这里来了，不过从示范代码中很容易明白作者真正想描述的问题，因此emu就不照翻原文了）</p>
<p>我们现在需要写一个函数来修改一个超链接的几个样式规则。要实现很简单，把这几个规则对应的属性逐一改了就好了。但是带来的问题是，每修改一个样式 属性，都会导致一次页面的重解析。</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;selectAnchor(element)&nbsp;{<br />
&nbsp;&nbsp;element.style.fontWeight&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'bold';<br />
&nbsp;&nbsp;element.style.textDecoration&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'none';<br />
&nbsp;&nbsp;element.style.color&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'#</span><span style="color: rgb(0, 0, 0);">000</span><span style="color: rgb(0, 0, 0);">';<br />
}</span></div>
<p>&nbsp;</p>
<p><strong>解决方案</strong></p>
<p>要解决这个问题，我们可以先创建一个样式名，并且把要修改的样式规则都放到这个类名上，然后我们给超链接添加上这个新类名，就可以实现添加几个样式 规则而只触发一次重解析了。这个模式还有个好处是也实现了表现和逻辑相分离。</p>
<p><br />
&nbsp;</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 0);">.selectedAnchor&nbsp;{<br />
&nbsp;&nbsp;font</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">weight:&nbsp;bold;<br />
&nbsp;&nbsp;text</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">decoration:&nbsp;none;<br />
&nbsp;&nbsp;color:&nbsp;#</span><span style="color: rgb(0, 0, 0);">000</span><span style="color: rgb(0, 0, 0);">;<br />
}<br />
<br />
</span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;selectAnchor(element)&nbsp;{<br />
&nbsp;&nbsp;element.className&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'selectedAnchor';<br />
}</span></div>
<br />
<strong><span style="font-size: 18pt;"><strong>方案二：在非渲染区修改DOM</strong> </span></strong>
<p>（emu注：作者在这里再次脑子短路，把DocumentFragment DOM  Generation模式的介绍提前到这里来了，emu只好再次发挥一下）<br />
上一个方案解决的是修改一个超链接的问题，当一次需要对很多个超链接进行相同修改的时候，这个方案就可以大显身手了。</p>
<p><strong>需求</strong></p>
<p>需求是这样的，我们要写一个函数来修改一个指定元素的子元素中所有的超链接的样式名（className）属性。要实现很简单，我们可以通过遍历每 个超链接并且修改它们的样式名来完成任务。但是带来的问题就是，每修改一个超链接都会导致一次重解析。</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;updateAllAnchors(element,&nbsp;anchorClass)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;anchors&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;element.getElementsByTagName('a');<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,&nbsp;length&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchors.length;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">&nbsp;length;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchors[i].className&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorClass;<br />
&nbsp;&nbsp;}<br />
}</span></div>
<br />
<p><strong>解决方案</strong></p>
<p>要解决这个问题，我们可以把被修改的指定元素从DOM里面移除，再修改所有的超链接，然后在把这个元素插入回到它原来的位置上。为了完成这个复杂的 操作，我们可以先写一个可重用的函数，它不但移除了这个DOM节点，还返回了一个把元素插回到原来的位置的函数。</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">*<br />
&nbsp;*&nbsp;Remove&nbsp;an&nbsp;element&nbsp;and&nbsp;provide&nbsp;a&nbsp;function&nbsp;that&nbsp;inserts&nbsp;it&nbsp;into&nbsp;its&nbsp;original&nbsp;position<br />
&nbsp;*&nbsp;@param&nbsp;element&nbsp;{Element}&nbsp;The&nbsp;element&nbsp;to&nbsp;be&nbsp;temporarily&nbsp;removed<br />
&nbsp;*&nbsp;@return&nbsp;{Function}&nbsp;A&nbsp;function&nbsp;that&nbsp;inserts&nbsp;the&nbsp;element&nbsp;into&nbsp;its&nbsp;original&nbsp;position<br />
&nbsp;*</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />
</span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;removeToInsertLater(element)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;parentNode&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;element.parentNode;<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;nextSibling&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;element.nextSibling;<br />
&nbsp;&nbsp;parentNode.removeChild(element);<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(nextSibling)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parentNode.insertBefore(element,&nbsp;nextSibling);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parentNode.appendChild(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
}</span></div>
<br />
<p>有了上面这个函数，现在我们就可以在一个不需要解析渲染的元素上面修改那些超链接了。这样只在移除和插入元素的时候各触发一次重解析。</p>
<br />
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;updateAllAnchors(element,&nbsp;anchorClass)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;insertFunction&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;removeToInsertLater(element);<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;anchors&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;element.getElementsByTagName('a');<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,&nbsp;length&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchors.length;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">&nbsp;length;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchors[i].className&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorClass;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;insertFunction();<br />
}</span></div>
<br />
<p><span style="font-size: large;"><strong>方案三：一次性的DOM元素生成</strong></span></p>
<p>这个方案让我们创建一个元素的过程只触发一次重解析。在创建完元素以后，先进行所有需要的修改，最后才把它插入到DOM里面去就可以了</p>
<p><strong>需求</strong></p>
<p>需求是这样的，实现一个函数，往一个指定的父元素上插入一个超链接元素。这个函数要同时可以设置这个超链接的显示文字和样式类。我们可以这样做：创 建元素，插入到DOM里面，然后设置相应的属性。这就要触发3次重解析。</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;addAnchor(parentElement,&nbsp;anchorText,&nbsp;anchorClass)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;element&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;document.createElement('a');<br />
&nbsp;&nbsp;parentElement.appendChild(element);<br />
&nbsp;&nbsp;element.innerHTML&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorText;<br />
&nbsp;&nbsp;element.className&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorClass;<br />
}</span></div>
<br />
<p><strong>解决方案</strong></p>
<p>很简单，我们只要把插入元素这个操作放到最后做，就可以只进行一次重解析了。</p>
<br />
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;addAnchor(parentElement,&nbsp;anchorText,&nbsp;anchorClass)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;element&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;document.createElement('a');<br />
&nbsp;&nbsp;element.innerHTML&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorText;<br />
&nbsp;&nbsp;element.className&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;anchorClass;<br />
&nbsp;&nbsp;parentElement.appendChild(element);<br />
}</span></div>
<br />
<p>不过，要是我们想要插入很多个超链接到一个元素里面的话，那么这个做法还是有问题：每插入一个超链接还是要触发一次重解析。下一个方案可以解决这个 问题。</p>
<p><strong style="font-size: 18pt;">方案四：通过文档片段对象（DocumentFragment）创建一组元素</strong></p>
<p>这个方案允许我们创建并插入很多个元素而只触发一次重解析。要实现这点需要用到所谓的文档片段对象（DocumentFragment）。我们先在 DOM之外创建一个文档片段对象（这样它也就不需要解析和渲染），然后我们在文档片段对象中创建很多个元素，最后我们把这个文档片段对象中所有的元素一次 性放到DOM里面去，只触发一次重解析。</p>
<p><strong>需求</strong></p>
<p><br />
我们要写一个函数，往一个指定的元素上面增加10个超链接。如果我们简单的直接插入10个超链接到元素上面，就会触发10次重解析。</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;addAnchors(element)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;anchor;<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">10</span><span style="color: rgb(0, 0, 0);">;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchor&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;document.createElement('a');<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchor.innerHTML&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'test';<br />
&nbsp;&nbsp;&nbsp;&nbsp;element.appendChild(anchor);<br />
&nbsp;&nbsp;}<br />
}</span></div>
<br />
<p><strong>解决方案</strong></p>
<p>要解决这个问题，我们要先创建一个文档片段对象，然后把每个新创建的超链接都插入到它里面去。当我们把文档片段对象用appendChild命令插 入到指定的节点时，这个文档片段对象的所有子节点就一起被插入到指定的元素里面，而且只需要触发一次重解析。<br />
</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); width: 98%; font-size: 13px;"><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">&nbsp;addAnchors(element)&nbsp;{<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;anchor,&nbsp;fragment&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;document.createDocumentFragment();<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">&nbsp;(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">10</span><span style="color: rgb(0, 0, 0);">;&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchor&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;document.createElement('a');<br />
&nbsp;&nbsp;&nbsp;&nbsp;anchor.innerHTML&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;'test';<br />
&nbsp;&nbsp;&nbsp;&nbsp;fragment.appendChild(anchor);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;element.appendChild(fragment);<br />
}</span></div>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=288</link>
			<title><![CDATA[转战杭州]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[My Life]]></category>
			<pubDate>Sun,28 Feb 2010 17:53:22 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=288</guid>
		<description><![CDATA[<p>终于，来到了杭州。</p>
<p>之前对这里是充满了很高的期望的。</p>
<p>晚上8点多到达，然后乘公车来到同事家。由于是晚上吧，感觉整个城市有点偏暗，另外，公车司机素质貌似与深圳那边的同行们有一定的差距，需要多多学习提高。</p>
<p>次日，随同事简单逛到了京杭大运河边上，看到河面上来往频繁的货轮和客轮，没想到，这条古运河仍然充满了活力，赞！</p>
<p>旁边是环球中心和浙江省博物馆，进到博物馆看看，布置的很有感觉，下次记得带相机去。</p>
<p>今天办理入职，一切顺利！^_^</p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=287</link>
			<title><![CDATA[AutoSizeBox 自适应父节点大小的类]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Mon,01 Feb 2010 17:23:06 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=287</guid>
		<description><![CDATA[<p>在做WEB APP项目的时候，经常会遇到一些自适应大小的需求，简单实现了一个，使用需谨慎！</p>
<h1 class="hd">自适应父节点大小类 - ARBox</h1>
<div class="bd"><dl><dt><strong>使用此方法的DOM元素：</strong> </dt><dd>将自动适应其父节点的宽和高; </dd><dd>如果指定了width=[整数|百分数]和height的值，将按给定的值调整; </dd><dd>该元素将被自动设置成为overflow:hidden; </dd><dd>支持rows=&quot;25,*25&quot;和cols=&quot;20%,*&quot;属性 </dd><dd>如果设置了rows或cols，其childNodes将按相应的值自动调整 </dd><dd>尺寸调整过的子节点，同时也会被自动设置成为overflow:hidden; </dd></dl><dl><dt><strong>嵌套的设置：</strong> </dt><dd>嵌套与本类无关，需要另行编写相关队列实现 </dd><dd>可使用自定义属性（如level）进行抓取，按level优先级存入队列 </dd><dd>window resize的时候可以按队列顺序进行调整 </dd></dl><dl><dt><strong>注意：</strong> </dt><dd>请声明DTD </dd><dd>最好在使用了reset样式后使用 </dd><dd>请酌情使用或参考 </dd></dl></div>
<p>在线演示：<a target="_blank" href="http://www.jslab.org.cn/?tag=AutoSizeBox">http://www.jslab.org.cn/?tag=AutoSizeBox</a></p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=286</link>
			<title><![CDATA[border none的兼容处理]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Mon,01 Feb 2010 15:31:29 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=286</guid>
		<description><![CDATA[<h2>最近为<a target="_blank" href="http://www.easyui.org.cn">easyui</a>添加了一个方法<a target="_blank" href="http://www.easyui.org.cn/#getMarginPaddingBorder">getmpb</a>，用来取DOM元素的Margin,Padding和Border。</h2>
<p>&nbsp;在处理border的时候遇到了浏览器兼容的问题，给我们&ldquo;找麻烦&rdquo;的是<strong>Opera</strong>同学！</p>
<p><strong>问题描述：</strong></p>
<p><strong>有DOM对象：dobj，当此对象未设置border样式的时候，我们通过dobj.currentStyle.borderWidth得到的值会是3，当我们设置此对象的border:none时，dobj.currentStyle.borderWidth仍然会是3。</strong></p>
<p>当然，在浏览器渲染的时候并不会因为此问题而将border显示出来，因为borderStyle和borderColor都没有设置。</p>
<p>可以考虑在以后的CSS书写中，将border:none更改为border:0，这样就可以保证各浏览器在JS取border值时的一致了。</p>
<p>在<a target="_blank" href="http://www.easyui.org.cn/#getMarginPaddingBorder">easyui.getmpb</a>中对opera的此问题单独做了修正，所以可以放心使用。^_^</p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=285</link>
			<title><![CDATA[入手WII]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[My Life]]></category>
			<pubDate>Wed,27 Jan 2010 20:07:09 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=285</guid>
		<description><![CDATA[<p>&nbsp;一个偶然的机会，去到一家游戏机销售店，体验了一下WII的新超级玛利兄弟，后来又体验了一下体感操作的运动系列游戏，立即被它给吸引，入手一台，说是给儿子玩，怕是要和他抢着玩了！ ^_^</p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=284</link>
			<title><![CDATA[重生]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[My Life]]></category>
			<pubDate>Mon,18 Jan 2010 17:57:34 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=284</guid>
		<description><![CDATA[<p>服务器杯具鸟一个月，另辟蹊径，重生！</p>
<p>最近更新了<a target="_blank" href="http://www.easyui.org.cn">EasyUI</a>及相关组件，<a target="_blank" href="http://www.easyui.org.cn/dhatv_demo.html">dhATV4</a>有重大更新！</p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=283</link>
			<title><![CDATA[EasyChange兼容处理input控件值改变事件]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Wed,06 Jan 2010 16:47:12 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=283</guid>
		<description><![CDATA[<h1>EasyChange兼容处理input控件值改变事件</h1>
<dl><dt>兼容处理：</dt><dd>手动输入事件捕获：手动输入内容时会触发</dd><dd>复制粘贴事件捕获：复制粘贴内容时会触发</dd><dd>程序设置事件捕获：javascript程序动态设置内容时会触发</dd><dd>拖入事件捕获：选定内容拖入时会触发<br />
</dd></dl>
<p>原型代码：</p>
<p>var easychange = function(foochange){<br />
&nbsp;&nbsp;&nbsp; if(!foochange||foochange.constructor!=Function){return;}<br />
&nbsp;&nbsp;&nbsp; try{this.watch(&quot;value&quot;,function(id,oldval,newval){foochange(newval);return newval;});}catch(e){}<br />
&nbsp;&nbsp;&nbsp; this.setAttribute('oninput','('+foochange.toString()+')(this.value)');<br />
&nbsp;&nbsp;&nbsp; this.onpropertychange = function(){foochange(this.value);};<br />
&nbsp;&nbsp;&nbsp; this.onmousemove = function(){foochange(this.value);};<br />
&nbsp;&nbsp;&nbsp; this.onkeyup = function(){foochange(this.value);};<br />
};</p>
<p>在线演示：<a href="http://www.jslab.org.cn/?tag=easyChange" target="_blank">http://www.jslab.org.cn/?tag=easyChange</a></p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=282</link>
			<title><![CDATA[JavaScript版Bresenham直线,圆,椭圆算法]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Tue,05 Jan 2010 16:03:12 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=282</guid>
		<description><![CDATA[<h1 style="line-height: 1.8">Bresenham图形算法JavaScript版本</h1>
<p><strong>/*Bresenham画圆算法*/<br />
</strong>var arc = function(x0,y0,r){/*起点坐标x0,y0,半径*/<br />
&nbsp;var p,x,y,i,ret = [];<br />
&nbsp;p = 3-2*r,x = 0,y = r,i = r;<br />
&nbsp;for(;x&lt;=y;){<br />
&nbsp;&nbsp;ret.push([x+i+x0,y+i+y0]);<br />
&nbsp;&nbsp;ret.push([-x+i+x0,-y+i+y0]);<br />
&nbsp;&nbsp;ret.push([-x+i+x0,y+i+y0]);<br />
&nbsp;&nbsp;ret.push([x+i+x0,-y+i+y0]);<br />
&nbsp;&nbsp;ret.push([y+i+x0,x+i+y0]);<br />
&nbsp;&nbsp;ret.push([-y+i+x0,x+i+y0]);<br />
&nbsp;&nbsp;ret.push([-y+i+x0,-x+i+y0]);<br />
&nbsp;&nbsp;ret.push([y+i+x0,-x+i+y0]);<br />
&nbsp;&nbsp;if(p&lt;0){<br />
&nbsp;&nbsp;&nbsp;p = p+4*x+6;<br />
&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;y--,p = p+4*(x-y)+10;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;x++;<br />
&nbsp;}<br />
&nbsp;return ret.slice(0);<br />
};</p>
<p><br />
<strong>/*Bresenham画椭圆算法*/</strong><br />
var ellipse = function(px,py,rx,ry){/*起点坐标px,py,x轴半径rx,y轴半径ry*/<br />
&nbsp;px = px+rx,py = py+ry;<br />
&nbsp;var x = 0,y = ry,rx2 = rx*rx,ry2 = ry*ry,ret = [];<br />
&nbsp;var dx = ry2/Math.sqrt(ry2+rx2),p = ry2-rx2*ry;<br />
&nbsp;while(dx&lt;=y){<br />
&nbsp;&nbsp;ret.push([px+x,py+y]);<br />
&nbsp;&nbsp;ret.push([px+x,py-y]);<br />
&nbsp;&nbsp;ret.push([px-x,py+y]);<br />
&nbsp;&nbsp;ret.push([px-x,py-y]);<br />
&nbsp;&nbsp;if(p&lt;=0){<br />
&nbsp;&nbsp;&nbsp;++x;<br />
&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;++x,--y;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;p = ry2*(x+1)*(x+1)+rx2*(y*y-y)-rx2*ry2;<br />
&nbsp;}<br />
&nbsp;p = ry2*(x*x+x)+rx2*(y*y-y)-rx2*ry2;<br />
&nbsp;while(y&gt;0){<br />
&nbsp;&nbsp;ret.push([px+x,py+y]);<br />
&nbsp;&nbsp;ret.push([px+x,py-y]);<br />
&nbsp;&nbsp;ret.push([px-x,py+y]);<br />
&nbsp;&nbsp;ret.push([px-x,py-y]);<br />
&nbsp;&nbsp;if(p&gt;=0){<br />
&nbsp;&nbsp;&nbsp;--y,p = p-2*rx2*y-rx2;<br />
&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;--y,++x,p = p-2*rx2*y-rx2+2*ry2*x+2*ry2;<br />
&nbsp;&nbsp;}<br />
&nbsp;}<br />
&nbsp;ret.push([px+x,py]);<br />
&nbsp;ret.push([px-x,py]);<br />
&nbsp;return ret.slice(0);<br />
};</p>
<p><br />
<strong>/*Bresenham画直线算法*/<br />
</strong>var line = function(x1,y1,x2,y2){/*起点坐标x1,y1,终点坐标x2,y2*/<br />
&nbsp;var dx,dy,h,x,y,t,ret = [];<br />
&nbsp;if(x1&gt;x2){x1 = [x2,x2=x1][0],y1 = [y2,y2=y1][0];}<br />
&nbsp;dx = x2-x1,dy = y2-y1,x = x1,y = y1;<br />
&nbsp;if(!dx){<br />
&nbsp;&nbsp;t = (y1&gt;y2)?-1:1;<br />
&nbsp;&nbsp;while(y!=y2){ret.push([x,y]);y += t;}<br />
&nbsp;&nbsp;return ret.slice(0);<br />
&nbsp;}<br />
&nbsp;if(!dy){<br />
&nbsp;&nbsp;while(x!=x2){ret.push([x,y]);x++;}<br />
&nbsp;&nbsp;return ret.slice(0);<br />
&nbsp;}<br />
&nbsp;if(dy&gt;0){<br />
&nbsp;&nbsp;if(dy&lt;=dx){<br />
&nbsp;&nbsp;&nbsp;h = 2*dy-dx,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;while(x!=x2){<br />
&nbsp;&nbsp;&nbsp;&nbsp;if(h&lt;0){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*dy;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y++,h += 2*(dy-dx);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;x++,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;h = 2*dx-dy,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;while(y!=y2){<br />
&nbsp;&nbsp;&nbsp;&nbsp;if(h&lt;0){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*dx;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++x,h += 2*(dx-dy);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;y++,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
&nbsp;}else{<br />
&nbsp;&nbsp;t = -dy;<br />
&nbsp;&nbsp;if(t&lt;=dx){<br />
&nbsp;&nbsp;&nbsp;h = 2*dy+dx,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;while(x!=x2){<br />
&nbsp;&nbsp;&nbsp;&nbsp;if(h&lt;0){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*(dy+dx),y--;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*dy;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;x++,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;dy = -dy,dx = -dx,y = y2,x = x2,ret.push([x,y]),h = 2*dx+dy;<br />
&nbsp;&nbsp;&nbsp;while(y!=y1){<br />
&nbsp;&nbsp;&nbsp;&nbsp;if(h&lt;0){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*(dx+dy),x--;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h += 2*dx;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;y++,ret.push([x,y]);<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
&nbsp;}<br />
&nbsp;return ret.slice(0);<br />
};<br />
&nbsp;</p>
<p>参见：<a target="_blank" href="http://www.jslab.org.cn/?tag=Bresenham">Bresenham直线,圆,椭圆算法</a></p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=281</link>
			<title><![CDATA[The Canvas 2D API 1.0 Specification]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Tue,05 Jan 2010 15:44:18 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=281</guid>
		<description><![CDATA[<h1>Canvas 2D API Specification 1.0</h1>
<!--:ZZZ Update: W3C Editor's Draft 25 August 2009 -->
<h2 class="no-num no-toc">W3C Editor's Draft 21 October 2009</h2>
<p><strong>The <dfn id="canvas-interface-element"><code>canvas interface</code></dfn> element</strong></p>
<pre class="idl">
interface <dfn id="canvaselement">CanvasElement</dfn> : <font color="#660099">Element</font> {
      attribute unsigned long <font color="#660099">width</font>;
      attribute unsigned long <font color="#660099">height</font>;

      Object <font color="#660099">getContext</font>(in DOMString contextId);//2d

      DOMString <font color="#660099">toDataURL</font>(optional in DOMString type, in any... args);
      //image/png, quality level 0.0 to 1.0 ...
};</pre>
<p><strong>The 2D Drawing Context</strong></p>
<pre class="idl">
interface <dfn id="canvasrenderingcontext2d">CanvasRenderingContext2D</dfn> {

  // back-reference to the canvas 
  readonly attribute <font color="#0000cc">HTMLCanvasElement</font> <font color="#660099">canvas</font>;

  // state 
  void <font color="#660099">restore</font>(); // pop state stack and restore state
  void <font color="#660099">save</font>(); 	  // push state on state stack 
        <!--
          // v4 we've also received requests for:
                  attribute boolean <span title="dom-context-2d-forceHighQuality">forceHighQuality</span> // (default false)
          // when enabled, it would prevent the UA from falling back on lower-quality but faster rendering routines
          // useful e.g. for when an image manipulation app uses <canvas> both for UI previews and the actual work
        -->
  // transformations (default transform is the identity matrix)
  void <font color="#660099">rotate</font>(in float angle);
  void <font color="#660099">scale</font>(in float x, in float y);

  void <font color="#660099">setTransform</font>(in float m11, in float m12, in float m21, in float m22, 
  in float dx, in float dy);

  void <font color="#660099">transform</font>(in float m11, in float m12, in float m21, in float m22, 
  in float dx, in float dy);

  void <font color="#660099">translate</font>(in float x, in float y);
        <!--
          // v4 we've also received requests for:
          void skew(...);
          void reflect(...); // or mirror(...)
        -->
  // compositing 
  attribute float <font color="#660099">globalAlpha</font>; // (default 1.0)
  attribute DOMString <font color="#660099">globalCompositeOperation</font>; // (default source-over)
        <!--
          // v4 we've also received requests for:
          - turning off antialiasing to avoid seams when patterns are painted next to each other
            - might be better to overdraw?
            - might be better to just draw at a higher res then downsample, like for 3d?
          - nested layers
            - the ability to composite an entire set of drawing operations with one shadow all at once http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-August/015567.html
        -->
  // colors and styles 
  attribute any <font color="#660099">fillStyle</font>; // (default black)
  attribute any <font color="#660099">strokeStyle</font>; // (default black)
  <font color="#660099">CanvasGradient</font> <font color="#660099">createLinearGradient</font>(in float x0, in float y0, in float x1, in float y1);

  <font color="#660099">CanvasGradient</font> <font color="#660099">createRadialGradient</font>(in float x0, in float y0, in float r0, in float x1, 
  in float y1, in float r1);

  <font color="#660099">CanvasPattern</font> <font color="#660099">createPattern</font>(in <font color="#0000cc">HTMLImageElement</font> image, in DOMString repetition);
  <font color="#660099">CanvasPattern</font> <font color="#660099">createPattern</font>(in <font color="#0000cc">HTMLCanvasElement</font> image, in DOMString repetition);
  <font color="#660099">CanvasPattern</font> <font color="#660099">createPattern</font>(in <font color="#0000cc">HTMLVideoElement</font> image, in DOMString repetition);

  // line st<span class="style1"><font style="background-color: #eeeeee">yles</font></span> 
  attribute DOMString <font color="#660099">lineCap</font>; // &quot;butt&quot;, &quot;round&quot;, &quot;square&quot; (default &quot;butt&quot;)
  attribute DOMString <font color="#660099">lineJoin</font>; // &quot;miter&quot;, &quot;round&quot;, &quot;bevel&quot;  (default &quot;miter&quot;)
  attribute float <font color="#660099">lineWidth</font>; // (default 1)
  attribute float <font color="#660099">miterLimit</font>; // (default 10)

  // shadows 
  attribute float <font color="#660099">shadowBlur</font>; // (default 0)
  attribute DOMString <font color="#660099">shadowColor</font>; // (default transparent black)
  attribute float <font color="#660099">shadowOffsetX</font>; // (default 0)
  attribute float <font color="#660099">shadowOffsetY</font>; // (default 0)

  // rects 
  void <font color="#660099">clearRect</font>(in float x, in float y, in float w, in float h);
  void <font color="#660099">fillRect</font>(in float x, in float y, in float w, in float h);
  void <font color="#660099">strokeRect</font>(in float x, in float y, in float w, in float h);

  // Complex shapes (paths) API 
  void <font color="#660099">arc</font>(in float x, in float y, in float radius, in float startAngle, in float endAngle,
  in boolean anticlockwise);

  void <font color="#660099">arcTo</font>(in float x1, in float y1, in float x2, in float y2, in float radius);
  void <font color="#660099">beginPath</font>();

  void <font color="#660099">bezierCurveTo</font>(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x,
  in float y);

  void <font color="#660099">clip</font>();
  void <font color="#660099">closePath</font>();
  void <font color="#660099">fill</font>();
  void <font color="#660099">lineTo</font>(in float x, in float y);
  void <font color="#660099">moveTo</font>(in float x, in float y);
  void <font color="#660099">quadraticCurveTo</font>(in float cpx, in float cpy, in float x, in float y);
  void <font color="#660099">rect</font>(in float x, in float y, in float w, in float h);
  void <font color="#660099">stroke</font>();
  boolean <font color="#660099">isPointInPath</font>(in float x, in float y);

  // text 
  attribute DOMString <font color="#660099">font</font>; // (default 10px sans-serif)
  attribute DOMString <font color="#660099">textAlign</font>; // &quot;start&quot;, &quot;end&quot;, &quot;left&quot;, &quot;right&quot;,
  &quot;center&quot; (default: &quot;start&quot;)

  attribute DOMString <font color="#660099">textBaseline</font>; // &quot;top&quot;, &quot;hanging&quot;, &quot;middle&quot;,
  &quot;alphabetic&quot;, &quot;ideographic&quot;,&quot;bottom&quot; (default: &quot;alphabetic&quot;)

  void <font color="#660099">fillText</font>(in DOMString text, in float x, in float y, optional in float maxWidth);
  <font color="#660099">TextMetrics</font> <font color="#660099">measureText</font>(in DOMString text);
  void <font color="#660099">strokeText</font>(in DOMString text, in float x, in float y, optional in float maxWidth);<!-- v4DVT void <span title="dom-context-2d-fillVerticalText">fillVerticalText</span>(in DOMString text, in float x, in float y, optional in float maxHeight);
          void <span title="dom-context-2d-strokeVerticalText">strokeVerticalText</span>(in DOMString text, in float x, in float y, optional in float maxHeight); -->

  // drawing images 
  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLImageElement</font> image, in float dx, in float dy, optional in float dw,
  in float dh);

  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLImageElement</font> image, in float sx, in float sy, in float sw, in float
  sh, in float dx, in float dy, in float dw, in float dh);

  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLCanvasElement</font> image, in float dx, in float dy, optional in float dw,
  in float dh);

  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLCanvasElement</font> image, in float sx, in float sy, in float sw,
  in float sh, in float dx, in float dy, in float dw, in float dh);

  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLVideoElement</font> image, in float dx, in float dy, optional in float dw,
  in float dh);

  void <font color="#660099">drawImage</font>(in <font color="#0000cc">HTMLVideoElement</font> image, in float sx, in float sy, in float sw,
  in float sh, in float dx, in float dy, in float dw, in float dh);

  // pixel manipulation
  <font color="#660099">ImageData</font> <font color="#660099">createImageData</font>(in float sw, in float sh);
  <font color="#660099">ImageData</font> <font color="#660099">createImageData</font>(in <font color="#660099">ImageData</font> imagedata);
  <font color="#660099">ImageData</font> <font color="#660099">getImageData</font>(in float sx, in float sy, in float sw, in float sh);
  void <font color="#660099">putImageData</font>(in <font color="#660099">ImageData</font> imagedata,in float dx,in float dy,optional in float dirtyX,
  in float dirtyY, in float dirtyWidth, in float dirtyHeight);
};

interface <dfn id="canvasgradient">CanvasGradient</dfn> {
  // opaque object 
  void <font color="#660099">addColorStop</font>(in float offset, in DOMString color);
};

interface <dfn id="canvaspattern">CanvasPattern</dfn> {
  // opaque object
};

interface <dfn id="textmetrics">TextMetrics</dfn> {
  readonly attribute float <font color="#660099">width</font>;
};

interface <dfn id="imagedata">ImageData</dfn> {
  readonly attribute <font color="#660099">CanvasPixelArray</font> <font color="#660099">data</font>;
  readonly attribute unsigned long <font color="#660099">height</font>;
  readonly attribute unsigned long <font color="#660099">width</font>;
};

interface <dfn id="canvaspixelarray">CanvasPixelArray</dfn> {
  readonly attribute unsigned long <font color="#660099">length</font>;
  <font color="#660099">getter</font> octet (in unsigned long index);
  <font color="#660099">setter</font> void (in unsigned long index, in octet value);
};
}</pre>
<p>See also: <a target="_blank" href="http://dev.w3.org/html5/canvas-api/canvas-2d-api.html"><font color="#660099">http://dev.w3.org/html5/canvas-api/canvas-2d-api.html</font></a></p>
<p>&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.v-ec.com/dh20156/article.asp?id=280</link>
			<title><![CDATA[EasyUI新组件EasySlider]]></title>
			<author>dh20156@126.com(dh20156)</author>
			<category><![CDATA[Web Develop]]></category>
			<pubDate>Mon,04 Jan 2010 15:57:53 +0800</pubDate>
			<guid>http://www.v-ec.com/dh20156/default.asp?id=280</guid>
		<description><![CDATA[<h1><span style="font-size: 20px">EasySlider - EasyUI Components</span></h1>
<p><strong>依赖</strong> <br />
&nbsp; &nbsp; http://www.easyui.org.cn/easyui.js <br />
&nbsp; &nbsp; http://www.easyui.org.cn/easydragdrop.js <br />
<br />
<strong>实例化</strong> <br />
&nbsp; &nbsp; new easySlider(100,0,100,46,'left','easyslider/',dalpha); <br />
&nbsp; &nbsp; new easySlider(默认值，起始值，结束值，上下左右四个方向，滑块样式目录，父节点) <br />
<br />
<strong>事件</strong> <br />
&nbsp; &nbsp; ondrag <br />
&nbsp; &nbsp; 滑块实例.ondrag = function(n){}; <br />
&nbsp; &nbsp; 参数n由滑块对象自动传出，只要指定该形参即可使用。 <br />
<br />
<strong>方法</strong> <br />
&nbsp; &nbsp; setValue(整数值value) <br />
&nbsp; &nbsp; getValue() <br />
<br />
<strong>EasySlider在线演示：</strong><a title="http://www.easyui.org.cn/easyslider.html" href="http://www.easyui.org.cn/easyslider.html" target="_blank"><strong><font color="#002d93">http://www.easyui.org.cn/easyslider.html</font></strong></a></p>]]></description>
		</item>
		
</channel>
</rss>
