<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>冰剑'blog - javascript</title><link>http://www.xunzou.com/blog/</link><description>专注于WEB前端开发 | 2010 重生 - </description><generator>RainbowSoft Studio Z-Blog 1.8 Walle Build 91204</generator><language>zh-CN</language><copyright>Copyright 2010 xunzou.com. Rights Reserved.备案序号:豫ICP备05003168号var gaJsHost = ((&amp;quot;https:&amp;quot; == document.location.protocol) ? &amp;quot;https://ssl.&amp;quot; : &amp;quot;http://www.&amp;quot;);document.write(unescape(&amp;quot;%3Cscript src='&amp;quot; + gaJsHost + &amp;quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&amp;quot;));try {var pageTracker = _gat._getTracker(&amp;quot;UA-11478901-1&amp;quot;);pageTracker._trackPageview();} catch(err) {}</copyright><pubDate>Wed, 08 Sep 2010 23:18:26 +0800</pubDate><item><title>[转]用cssText批量修改样式</title><author>xunzou@gmail.com (冰剑)</author><link>http://www.xunzou.com/blog/post/592.html</link><pubDate>Mon, 31 Aug 2009 15:49:46 +0800</pubDate><guid>http://www.xunzou.com/blog/post/592.html</guid><description><![CDATA[在<a href="http://www.css88.com/archives/1849" target="_blank"><b>码头哥</b></a>的网站上看到的这个，确实不错，但是Aptana的代码提示却没有提示！<br/><blockquote><div class="quote"><br/>一般情况下我们用js设置元素对象的样式会使用这样的形式：<br/><br/>var element= document.getElementById(”id”);<br/>element.style.width=”20px”;<br/>element.style.height=”20px”;<br/>element.style.border=”solid 1px red”;<br/><br/>样式一多，代码就很多；而且通过JS来覆写对象的样式是比较典型的一种销毁原样式并重建的过程，这种销毁和重建，都会增加浏览器的开销。<br/><br/>js中有一个cssText的方法：<br/><br/>语法为：obj.style.cssText=”样式”；<br/><br/>element.style.cssText=”width:20px;height:20px;border:solid 1px red;”;<br/><br/>这样就可以尽量避免页面reflow，提高页面性能。<br/></div></blockquote>]]></description><category>javascript</category><comments>http://www.xunzou.com/blog/post/592.html#comment</comments><wfw:comment>http://www.xunzou.com/blog/</wfw:comment><wfw:commentRss>http://www.xunzou.com/blog/feed.asp?cmt=592</wfw:commentRss><trackback:ping>http://www.xunzou.com/blog/cmd.asp?act=tb&amp;id=592&amp;key=6de3962e</trackback:ping></item></channel></rss>
