<?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>等待-放飞梦想 &#187; 前端交互</title>
	<atom:link href="http://leotheme.cn/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://leotheme.cn</link>
	<description>勤现在-乐将来</description>
	<lastBuildDate>Wed, 25 Apr 2012 09:45:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>使用lesscss来编码编写css</title>
		<link>http://leotheme.cn/javascript/use-lesscss-edit-css.html</link>
		<comments>http://leotheme.cn/javascript/use-lesscss-edit-css.html#comments</comments>
		<pubDate>Sat, 24 Sep 2011 05:10:24 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[lesscss]]></category>
		<category><![CDATA[编缉器]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=958</guid>
		<description><![CDATA[lesscss 是动态的样式表语言，他让css增加变量，组合，函数，运算等语法。这个项目的网站在国内访问不到，大家都懂的。 lesscss使用方法有两种： 页面添加一个 less.js的文件，css使用 style.less 文件后缀来编写，不过需要有服务器的环境支持 &#60;link rel=&#34;stylesheet/less&#34; type=&#34;text/css&#34; href=&#34;styles.less&#34;&#62; &#60;script&#160;src=&#34;less.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; 在服务器端使用node.js来编译，node.js 使用 less的方法如下： 先使用npm包管理器来安装 $ npm install less 然后就可以使用命令行来编译压缩less代码了 $ lessc styles.less > styles.css 下面是一些lesscss的语法： 1、使用变量： // LESS @color: #4D926F; #header&#160;{ &#160; color: @color; } h2&#160;{ &#160; color: @color; } /*&#160;Compiled CSS */ #header&#160;{ &#160; color:&#160;#4D926F; } h2&#160;{ &#160; color:&#160;#4D926F; } 2、组合 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="IE6因为编码问题无法正确解析CSS文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-css-zhusi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6因为编码问题无法正确解析CSS文件</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fcss-3-0-chm.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于CSS的书写习惯" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-css-style.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于CSS的书写习惯</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS中关于背景图的应用技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-css-background.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6199351.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS中关于背景图的应用技巧</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浮动的一些方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fcss-clear-float-fangfa.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浮动的一些方法</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>lesscss 是动态的样式表语言，他让css增加变量，组合，函数，运算等语法。这个项目的网站在国内访问不到，大家都懂的。</p>
<p>lesscss使用方法有两种：</p>
<p>页面添加一个 less.js的文件，css使用 style.less 文件后缀来编写，不过需要有服务器的环境支持<br />
<span id="more-958"></span></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Olive;">&lt;</span><span style="color: Green;">link</span><span style="color: Gray;"> </span><span style="color: #00008b;">rel</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">stylesheet/less</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">type</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text/css</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">styles.less</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Olive;">&lt;</span><span style="color: Green;">script</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">src</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">less.js</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">type</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text/javascript</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">script</span><span style="color: Olive;">&gt;</span></li></ol></div>
<p>    在服务器端使用node.js来编译，node.js 使用 less的方法如下：<br />
    先使用npm包管理器来安装<br />
    $ npm install less<br />
    然后就可以使用命令行来编译压缩less代码了<br />
    $ lessc styles.less > styles.css</p>
<p><img src="http://leotheme.cn/wp-content/uploads/2011/09/2011080118002730.jpg" alt="lesscss" title="2011080118002730" width="600" height="220" class="alignnone size-full wp-image-959" /><br />
下面是一些lesscss的语法：</p>
<p>1、使用变量：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">// </span><span style="color: Blue;">LESS</span></li>
<li><span style="color: #00008b;">@color</span><span style="color: Gray;">: #4</span><span style="color: Blue;">D926F</span><span style="color: Gray;">;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;"> @color</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">h2</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;"> @color</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">/</span><span style="color: Blue;">*</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">Compiled</span><span style="color: Gray;"> </span><span style="color: Blue;">CSS</span><span style="color: Gray;"> </span><span style="color: Blue;">*</span><span style="color: Gray;">/</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">#4D926F</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">h2</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">#4D926F</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>2、组合</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">// </span><span style="color: Blue;">LESS</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">.rounded-corners</span><span style="color: Gray;"> (</span><span style="color: #00008b;">@radius</span><span style="color: Gray;">: 5</span><span style="color: Blue;">px</span><span style="color: Gray;">) </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-radius:</span><span style="color: Gray;"> @radius</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">webkit-border-radius:</span><span style="color: Gray;"> @radius</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">moz-border-radius:</span><span style="color: Gray;"> @radius</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">.rounded-corners</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#footer</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">.rounded-corners</span><span style="color: Gray;">(10</span><span style="color: Blue;">px</span><span style="color: Gray;">);</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">/</span><span style="color: Blue;">*</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">Compiled</span><span style="color: Gray;"> </span><span style="color: Blue;">CSS</span><span style="color: Gray;"> </span><span style="color: Blue;">*</span><span style="color: Gray;">/</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">5</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">webkit-border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">5</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">moz-border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">5</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#footer</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">webkit-border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; -</span><span style="color: Green;">moz-border-radius:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>3、选择器</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">// </span><span style="color: Blue;">LESS</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">h1</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">font-size:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">26</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">font-weight:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">bold</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">p</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Green;">font-size:</span><span style="color: Gray;"> </span><span style="color: Maroon;">12</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Green;">text-decoration:</span><span style="color: Gray;"> </span><span style="color: Red;">none</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &amp;:</span><span style="color: Blue;">hover</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Green;">border-width:</span><span style="color: Gray;"> </span><span style="color: Maroon;">1</span><span style="color: Red;">px</span><span style="color: Gray;"> </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">/</span><span style="color: Blue;">*</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">Compiled</span><span style="color: Gray;"> </span><span style="color: Blue;">CSS</span><span style="color: Gray;"> </span><span style="color: Blue;">*</span><span style="color: Gray;">/</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">h1</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">font-size:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">26</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">font-weight:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">bold</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">p</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">font-size:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">12</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">p</span><span style="color: Gray;"> </span><span style="color: Blue;">a</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">text-decoration:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">none</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">p</span><span style="color: Gray;"> </span><span style="color: Blue;">a</span><span style="color: Navy;">:hover</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-width:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">1</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>4、变量预算</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">// </span><span style="color: Blue;">LESS</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: #00008b;">@the</span><span style="color: Gray;">-border: 1</span><span style="color: Blue;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: #00008b;">@base</span><span style="color: Gray;">-color: #111;</span></li>
<li><span style="color: #00008b;">@red</span><span style="color: Gray;">:&nbsp; &nbsp; &nbsp; &nbsp; #842210;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;"> @base-color * </span><span style="color: Maroon;">3</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-left:</span><span style="color: Gray;"> @the-border</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-right:</span><span style="color: Gray;"> @the-border * </span><span style="color: Maroon;">2</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#footer</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;"> @base-color + </span><span style="color: #00008b;">#003300</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-color:</span><span style="color: Gray;"> desaturate(@</span><span style="color: #00008b;">red</span><span style="color: Gray;">, </span><span style="color: Maroon;">10</span><span style="color: Red;">%</span><span style="color: Gray;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">/</span><span style="color: Blue;">*</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">Compiled</span><span style="color: Gray;"> </span><span style="color: Blue;">CSS</span><span style="color: Gray;"> </span><span style="color: Blue;">*</span><span style="color: Gray;">/</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">#header</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">#333</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-left:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">1</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-right:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">2</span><span style="color: Red;">px</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
<li><span style="color: Blue;">#footer</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">color:</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">#114411</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">border-color:</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">#7d2717</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>5、import 外部css</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #00008b;">@import</span><span style="color: Gray;"> &quot;</span><span style="color: Blue;">lib.less</span><span style="color: Gray;">&quot;;</span></li>
<li><span style="color: #00008b;">@import</span><span style="color: Gray;"> &quot;</span><span style="color: Blue;">lib</span><span style="color: Gray;">&quot;;</span></li></ol></div>
<p>通用引用了lesscss，我们就可以将css写得模块化，有更好的阅读性。</p>
<p>首先可以通过 import 讲网站的样式分成 n个模块，当页面需要哪个模块就引用哪个。还可以将css3那些新增的功能定义成类库，由于有函数的功能，那些圆角，阴影之类样式只需要定义一次就可以了。讲页面需要使用到的主要文本，边框，背景色定义成变量给后续样式使用，到时网站风格需要改变，颜色也很好的修改。</p>
<p>我个人觉得先阶段lesscss的不足有：</p>
<blockquote><p>1. css3的样式不能自动补全其他浏览器的hack。<br />
     2.使用nodejs在window系统下的支持不够，不过最近刚刚不久发布了一个nodejs window版，这方面估计在不久的将来会改善<br />
     3.编辑器，ide对lesscss语法缩进支持不够友好。</p></blockquote>
<p>转自&#8211;强记<a href="http://www.cnblogs.com/qiangji/archive/2011/08/01/lesscss.html" target="_blank">《使用lesscss来编码编写css》</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="IE6因为编码问题无法正确解析CSS文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-css-zhusi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6因为编码问题无法正确解析CSS文件</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS 3.0 参考手册 (中文版)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fcss-3-0-chm.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197221.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS 3.0 参考手册 (中文版)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于CSS的书写习惯" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-css-style.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于CSS的书写习惯</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS中关于背景图的应用技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-css-background.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6199351.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS中关于背景图的应用技巧</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS清除浮动的一些方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fcss-clear-float-fangfa.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fuse-lesscss-edit-css.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS清除浮动的一些方法</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009-11-11 -- <a href="http://leotheme.cn/javascript/css-to-realize-accordant.html" title="左右两栏等高实现方法">左右两栏等高实现方法</a> (6)<br /><small>等高布局在实际的应用中会经常用到。最常见的是左边的内容很多。而右边的内容却很少。为了不让右边出现太多的空白，有时需要让右边的高度和左边的保持一致。实现的方法有很多，以前一般是用背景填充来模拟。虽然很简...</small></li><li>2009-08-30 -- <a href="http://leotheme.cn/javascript/css-3-0-chm.html" title="CSS 3.0 参考手册 (中文版)">CSS 3.0 参考手册 (中文版)</a> (9)<br /><small>作为一个Web开发者，保持对未来Web标准的关注、学习和了解是很重要的。不管你是第一次准备去认识CSS3，还是已经略知皮毛，这个来自腾讯的webteam发布的CSS 3.0 参考手册 (中文版)将有助...</small></li><li>2009-07-07 -- <a href="http://leotheme.cn/javascript/nuheshienide-css-gengyiyuedui.html" title="如何使你的CSS样式更易阅读?">如何使你的CSS样式更易阅读?</a> (15)<br /><small>在做wordpress主题的时候，样式是最重要的一部分。作为主题的制作者，我们不但要考滤页面的还原完整度，还要一个重要的就是要让CSS阅读起来很容易。因为不管我们怎么尽力去做到完美，但每个人都想主题更...</small></li><li>2009-06-18 -- <a href="http://leotheme.cn/javascript/about-css-style.html" title="关于CSS的书写习惯">关于CSS的书写习惯</a> (7)<br /><small>其实每个人都有自己喜欢的书写格式习惯，我在刚学CSS的时候，什么都不知道，只是要实现什么效果，我后就写个ID或类进去。放哪个位置也不管，丢进去就行了。反正效果实现了；后来当需要修改某些地方的时候，才发...</small></li><li>2009-06-03 -- <a href="http://leotheme.cn/javascript/css-auto-for-br.html" title="CSS实现自动换行的小技巧">CSS实现自动换行的小技巧</a> (4)<br /><small>大家都知道连续的英文或数字能是容器被撑大，不能根据容器的大小自动换行，下面是 CSS如何将他们换行的方法！

对于div

1.（IE浏览器）white-space:normal; word-...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/use-lesscss-edit-css.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Jsonp 方式跨域获取 json 数据</title>
		<link>http://leotheme.cn/javascript/jsonp-get-json-data.html</link>
		<comments>http://leotheme.cn/javascript/jsonp-get-json-data.html#comments</comments>
		<pubDate>Sat, 17 Sep 2011 00:56:02 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSONP]]></category>
		<category><![CDATA[weibo]]></category>
		<category><![CDATA[微博]]></category>
		<category><![CDATA[跨域]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=950</guid>
		<description><![CDATA[这两天一直大折腾这个腾讯微博的广播调用。在胖神的帮助下，总算完成的差不多了。基本上和腾讯微博的页面格式保持一致。 数据来源是用腾讯微博RSS/JSONP格式输出的地址。 http://v.t.qq.com/output/json.php?type=2&#38;name=Dawait&#38;sign=d9fbc9349a11247c6a891050c4fae755b023303a type=1 为我的广播； type=2 为我的首页时间线； 直接打开这个地址，会看到有一串很大的数据，weiboData({Data&#8230;});一开始不了解这个JSONP是啥玩意。所以用PHP把这个做相应处理后再输出JSON格式，然后AJAX请求，返回后处理。后来在胖神（现在叫胖帝了）的指导下，才知道可以直接用JS读取数据。于是一翻折腾，总算完成了。后来查了查下资料，了解了一下 jsonp 跨域请求方式.跟大家分享一下。 其实 jsonp 是个很简单的一个东西。 主要是利用了 script 标签对 javascript 文档的动态解析来实现。（其实也可以用eval函数）。 来个超简单的例子： &#60;!DOCTYPE html&#62; &#60;html lang=&#34;en&#34;&#62; &#60;head&#62; &#60;meta charset=&#34;UTF-8&#34; /&#62; &#60;title&#62;Test Jsonp&#60;/title&#62; &#60;meta name=&#34;author&#34; content=&#34;&#34; /&#62; &#60;meta name=&#34;keywords&#34; content=&#34;&#34; /&#62; &#60;meta name=&#34;description&#34; content=&#34;&#34; /&#62; &#60;script type=&#34;text/javascript&#34;&#62; function weiboData(data){ alert(data.msg); } &#60;/script&#62; &#60;script type=&#34;text/javascript&#34; src=&#34;http://v.t.qq.com/output/json.php?type=1&#38;name=Dawait&#38;sign=d9fbc9349a11247c6a891050c4fae755b023303a&#34;&#62;&#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;/body&#62; &#60;/html&#62; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="不刷新（AJAX）获取文章的内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196490.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">不刷新（AJAX）获取文章的内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于Tab(选项卡)的一些实现方式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabouttabs.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197326.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于Tab(选项卡)的一些实现方式</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="搜狐博客开放平台博客模板设计大赛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fnews%2Fsohublogdesign.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197089.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">搜狐博客开放平台博客模板设计大赛</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="如何合理使用链接打开方式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-openlinks.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何合理使用链接打开方式</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Opera中国版“朱雀”正式发布" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fnews%2Fopera-china-96.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197076.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Opera中国版“朱雀”正式发布</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天一直大折腾这个腾讯微博的广播调用。在胖神的帮助下，总算完成的差不多了。基本上和腾讯微博的页面格式保持一致。<br />
数据来源是用腾讯微博RSS/JSONP格式输出的地址。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">http</span><span style="color: Gray;">:</span><span style="color: #ffa500;">//v.t.qq.com/output/json.php?type=2&amp;name=Dawait&amp;sign=d9fbc9349a11247c6a891050c4fae755b023303a</span></li>
</ol></div>
<p>type=1 为我的广播；<br />
type=2 为我的首页时间线；<br />
直接打开这个地址，会看到有一串很大的数据，weiboData({Data&#8230;});一开始不了解这个JSONP是啥玩意。所以用PHP把这个做相应处理后再输出JSON格式，然后AJAX请求，返回后处理。后来在胖神（现在叫胖帝了）的指导下，才知道可以直接用JS读取数据。于是一翻折腾，总算完成了。后来查了查下资料，了解了一下 jsonp 跨域请求方式.跟大家分享一下。<br />
<span id="more-950"></span><br />
其实 jsonp 是个很简单的一个东西。<br />
主要是利用了 script 标签对 javascript 文档的动态解析来实现。（其实也可以用eval函数）。</p>
<p><strong>来个超简单的例子：</strong></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_GZZNPs">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot; /&gt;
  &lt;title&gt;Test Jsonp&lt;/title&gt;
  &lt;meta name=&quot;author&quot; content=&quot;&quot; /&gt;
  &lt;meta name=&quot;keywords&quot; content=&quot;&quot; /&gt;
  &lt;meta name=&quot;description&quot; content=&quot;&quot; /&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
	function weiboData(data){
       alert(data.msg);
    }
  &lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://v.t.qq.com/output/json.php?type=1&amp;name=Dawait&amp;sign=d9fbc9349a11247c6a891050c4fae755b023303a&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="Util.Code.Run('runcode_GZZNPs');"/> <input type="button" value="复制" class="runcode_button" onclick="Util.Code.Copy('runcode_GZZNPs');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>点击运行之后会弹出一个对话框，内容为OK。<br />
这里weiboData是回调函数名称，data就是里面的json数据。</p>
<p><strong>Jsonp原理：</strong></p>
<p>首先在客户端注册一个callback, 然后把callback的名字传给服务器。<br />
此时，服务器先生成 json 数据。<br />
然后以 javascript 语法的方式，生成一个function , function 名字就是传递上来的参数 jsonp.<br />
最后将 json 数据直接以入参的方式，放置到 function 中，这样就生成了一段 js 语法的文档，返回给客户端。<br />
客户端浏览器，解析script标签，并执行返回的 javascript 文档，此时数据作为参数，传入到了客户端预先定义好的 callback 函数里.（动态执行回调函数）</p>
<p>这个和上面的例子有点区别，腾讯微博是服务器生成固定的名称，客服端直接调用就行了。<br />
到此终于知道JSONP是啥了。大家也可以试试去折腾</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="不刷新（AJAX）获取文章的内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196490.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">不刷新（AJAX）获取文章的内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于Tab(选项卡)的一些实现方式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabouttabs.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197326.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于Tab(选项卡)的一些实现方式</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="搜狐博客开放平台博客模板设计大赛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fnews%2Fsohublogdesign.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197089.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">搜狐博客开放平台博客模板设计大赛</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="如何合理使用链接打开方式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fabout-openlinks.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何合理使用链接打开方式</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="爆笑，史上脾气最好的接线员" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fmusci%2Fshishangpqzuihaodjxy.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197185.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">爆笑，史上脾气最好的接线员</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2012-04-17 -- <a href="http://leotheme.cn/musci/work-it-right-tonight.html" title="Work it right tonight">Work it right tonight</a> (0)<br /><small>http://www.sarahc-media.ic.cz/Sarah%20Connor%20-%20Work%20It%20Right%20Tonight.mp3...</small></li><li>2011-09-01 -- <a href="http://leotheme.cn/wordpress/wordpress-themes-perfct.html" title="WordPress主题：perfct 1.0">WordPress主题：perfct 1.0</a> (96)<br /><small>已经很久很久没写日志了。更不知道有多久没有发布新主题了！好像已经失去了那种曾经的兴趣和动力，很多时候想写，却又找不到话题。有些技术上的文章想分享。但又懒得编缉。要分析，上代码，做实例。最终只是想想而已...</small></li><li>2011-06-07 -- <a href="http://leotheme.cn/wordpress/wordpress-query-post-paged.html" title="解决wordpress分页问题">解决wordpress分页问题</a> (0)<br /><small>这是为解决使用query_post()函数调用某一类文章后引起的分页问题的办法。

query_post()非常有用，可以输出wordpress主循环以外的自定义文章，但是缺点在于覆盖了post变...</small></li><li>2009-04-07 -- <a href="http://leotheme.cn/diary/today-go-home.html" title="今天要回老家了">今天要回老家了</a> (9)<br /><small>今天得早点起了，得去买票。算算有两年多没回老家了，现在的心情有点复杂。
这两天每天都是睡到中午11点多才起来。睡太晚了，精神不好，郁闷。
这个主题总算完成的差不多了，还有几个页面没做，回来后再整吧...</small></li><li>2008-09-11 -- <a href="http://leotheme.cn/news/kugoumobile.html" title="酷狗推出手机版">酷狗推出手机版</a> (2)<br /><small>

1. 低资源占用，软件内置解码器，高精度音质，并支持FLAC等高品质格式

2. 内置歌手头像自动识别显示，无需GPRS流量

3. 完美的歌词显示，并支持酷狗的KRC卡拉OK歌词
...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/jsonp-get-json-data.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>jQuery中queue和dequeue的用法</title>
		<link>http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html</link>
		<comments>http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html#comments</comments>
		<pubDate>Thu, 08 Sep 2011 07:57:00 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[dequeue]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[queue]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=945</guid>
		<description><![CDATA[今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现jQuery中有一个队列方法“queue”。 定义和用法 queue() 方法显示或操作在匹配元素上执行的函数队列。 queue和dequeue的过程主要是： 1，用queue把函数加入队列（通常是函数数组） 2，用dequeue将函数数组中的第一个函数取出，并执行(用shift()方法取出并执行） 也就意味着当再次执行dequeue的时候，得到的是另一个函数了 同时也意味着，如果不执行dequeue，那么队列中的下一个函数永远不会执行 对于一个元素上执行animate方法加动画，jQuery内部也会将其加入名为 fx 的函数队列 而对于多个元素要依次执行动画，则必须我们手动设置队列进行了。 一个例子，要两个div依次向左移动，点击这里查看 如果只是轮流移动次数较少，可以使用animate的回调函数来做，一个动画放在另一个动画的回调里边 比如 $(“#block1&#8243;).animate({left:”+=100&#8243;},function() { $(“#block2&#8243;).animate({left:”+=100&#8243;},function() { $(“#block1&#8243;).animate({left:”+=100&#8243;},function() { $(“#block2&#8243;).animate({left:”+=100&#8243;},function() { $(“#block1&#8243;).animate({left:”+=100&#8243;},function(){ alert(“动画结束”); }); }); }); }); }); 但这种方法当动画较多的时候简直是残忍。 此时利用queue和dequeue则显得简单很多： var FUNC=[ function() {$("#block1").animate({left:"+=100"},aniCB);}, function() {$("#block2").animate({left:"+=100"},aniCB);}, function() {$("#block1").animate({left:"+=100"},aniCB);}, function() {$("#block2").animate({left:"+=100"},aniCB);}, function() {$("#block1").animate({left:"+=100"},aniCB);}, function(){alert("动画结束")} ]; var aniCB=function() { $(document).dequeue(“myAnimation”); } $(document).queue(“myAnimation”,FUNC); aniCB(); 1，我首先建立了一个函数数组，里边是一些列需要依次执行的动画 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery性能优化指南" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-xingnen-youhua.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery性能优化指南</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery实现背景图渐变切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197230.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery实现背景图渐变切换</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现jQuery中有一个队列方法“queue”。<br />
<strong>定义和用法</strong><br />
queue() 方法显示或操作在匹配元素上执行的函数队列。<br />
<strong>queue和dequeue的过程主要是：</strong><br />
1，用queue把函数加入队列（通常是函数数组）<br />
2，用dequeue将函数数组中的第一个函数取出，并执行(用shift()方法取出并执行）<br />
<span id="more-945"></span><br />
也就意味着当再次执行dequeue的时候，得到的是另一个函数了<br />
同时也意味着，如果不执行dequeue，那么队列中的下一个函数永远不会执行</p>
<p>对于一个元素上执行animate方法加动画，jQuery内部也会将其加入名为 fx 的函数队列<br />
而对于多个元素要依次执行动画，则必须我们手动设置队列进行了。</p>
<p>一个例子，要两个div依次向左移动，<a href="http://shawphy.com/demo/queue.html" target="_blank">点击这里</a>查看<br />
如果只是轮流移动次数较少，可以使用animate的回调函数来做，一个动画放在另一个动画的回调里边<br />
比如<br />
<coolcode lang="js"><br />
    $(“#block1&#8243;).animate({left:”+=100&#8243;},function() {<br />
        $(“#block2&#8243;).animate({left:”+=100&#8243;},function() {<br />
            $(“#block1&#8243;).animate({left:”+=100&#8243;},function() {<br />
                $(“#block2&#8243;).animate({left:”+=100&#8243;},function() {<br />
                    $(“#block1&#8243;).animate({left:”+=100&#8243;},function(){<br />
                        alert(“动画结束”);<br />
                    });<br />
                });<br />
            });<br />
        });<br />
    });<br />
<coolcode><br />
但这种方法当动画较多的时候简直是残忍。</p>
<p>此时利用queue和dequeue则显得简单很多：<br />
<coolcode lang="js"><br />
    var FUNC=[<br />
        function() {$("#block1").animate({left:"+=100"},aniCB);},<br />
        function() {$("#block2").animate({left:"+=100"},aniCB);},<br />
        function() {$("#block1").animate({left:"+=100"},aniCB);},<br />
        function() {$("#block2").animate({left:"+=100"},aniCB);},<br />
        function() {$("#block1").animate({left:"+=100"},aniCB);},<br />
        function(){alert("动画结束")}<br />
    ];<br />
    var aniCB=function() {<br />
        $(document).dequeue(“myAnimation”);<br />
    }<br />
    $(document).queue(“myAnimation”,FUNC);<br />
    aniCB();<br />
</coolcode><br />
1，我首先建立了一个函数数组，里边是一些列需要依次执行的动画<br />
2，然后我定义了一个回调函数，用dequeue方法用来执行队列中的下一个函数<br />
3，接着把这个函数数组放到document上的myAnimation的队列中（可以选择任何元素，我只是为了方便而把这个队列放在document上）<br />
4，最后我开始执行队列中的第一个函数</p>
<p>这样做的好处在于函数数组是线性展开，增减起来非常方便。<br />
而且，当不要要继续进行接下来动画的时候(比如用户点了某个按钮)，只需要清空那个队列即可。而要增加更多则只需要加入队列即可<br />
<coolcode lang="js"><br />
    //清空队列<br />
    $(document).queue(“myAnimation”,[]);<br />
    //加一个新的函数放在最后<br />
    $(document).queue(“myAnimation”,function(){alert(“动画真的结束了！”)});<br />
</coolcode><br />
这当然也可以用于ajax之类的方法，如果需要一系列ajax交互，每个ajax都希望在前一个结束之后开始，之前最原始的方法就是用回调函数，但这样太麻烦了。同样利用queue添加队列，每次ajax之后的回调中执行一次dequeue即可。</p>
<p>摘自：<a href="http://shawphy.com/2009/04/how-to-use-queue-and-dequeue.html" target="_blank">http://shawphy.com/2009/04/how-to-use-queue-and-dequeue.html</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery性能优化指南" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-xingnen-youhua.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery性能优化指南</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery实现背景图渐变切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197230.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery实现背景图渐变切换</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (19)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-11-24 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html" title="JQ弹出层插件(tipsWindow 2.8)">JQ弹出层插件(tipsWindow 2.8)</a> (164)<br /><small>已更新为2.7...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html" title="分享Flight主题中的焦点图（基于JQ）">分享Flight主题中的焦点图（基于JQ）</a> (22)<br /><small>关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html" title="jquery ajax方法如load,get等 在Chrome下失效的问题">jquery ajax方法如load,get等 在Chrome下失效的问题</a> (4)<br /><small>最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下：


function getHtml(url,ctner){
//alert(c...</small></li><li>2009-11-30 -- <a href="http://leotheme.cn/javascript/ajax-load-post-content.html" title="不刷新（AJAX）获取文章的内容">不刷新（AJAX）获取文章的内容</a> (53)<br /><small>相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>未知宽度容器的居中解决方案</title>
		<link>http://leotheme.cn/javascript/dom-float-center.html</link>
		<comments>http://leotheme.cn/javascript/dom-float-center.html#comments</comments>
		<pubDate>Thu, 17 Feb 2011 02:27:36 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[居中]]></category>
		<category><![CDATA[未知宽度]]></category>
		<category><![CDATA[浮动]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=870</guid>
		<description><![CDATA[如上图所示的分页，其结构如下： &#60;div class=&#34;pagenavi&#34;&#62; &#160; &#160; &#60;ul&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;1/18&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;上一页&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#160;class=&#34;current&#34;&#62;&#60;a href=&#34;&#34; title=&#34;&#34;&#62;1&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;2&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;3&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;...&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;18&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a&#160;href=&#34;&#34; title=&#34;&#34;&#62;下一页&#60;/a&#62;&#60;/li&#62; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="解决wordpress分页问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-query-post-paged.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决wordpress分页问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE下中英文字体不能对齐原因及解决" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fiexiazywbunenduiji.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE下中英文字体不能对齐原因及解决</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="新主题预览图" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fnew-theme-demo.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196711.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">新主题预览图</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Google Chrome浏览器的隐藏功能和彩蛋" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fnews%2Fgooglechromedecaidan.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6199166.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Google Chrome浏览器的隐藏功能和彩蛋</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://leotheme.cn/javascript/dom-float-center.html/attachment/qq%e6%88%aa%e5%9b%be%e6%9c%aa%e5%91%bd%e5%90%8d" rel="attachment wp-att-871"><img src="http://leotheme.cn/wp-content/uploads/2011/02/QQ截图未命名.jpg" alt="分页图片" title="分页" width="358" height="54" class="alignnone size-full wp-image-871" /></a><br />
如上图所示的分页，其结构如下：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Olive;">&lt;</span><span style="color: Green;">div</span><span style="color: Gray;"> </span><span style="color: #00008b;">class</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">pagenavi</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">ul</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">1/18</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">上一页</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">class</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">current</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">1</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">2</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">3</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">...</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">18</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">a</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">下一页</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: Green;">li</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">ul</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Olive;">&lt;/</span><span style="color: Green;">div</span><span style="color: Olive;">&gt;</span></li></ol></div>
<p><span id="more-870"></span><br />
在这个结构中，“.pagenavi”是外部框架，100%宽度。而目的，是为了让“.pagenavi”下的“ul”块能够居中显示。可是因为“ul”块中的节点“li”并不固定且为块元素，所以无法确认其父层最终宽度。我们知道一般情况下要让元素居中，直接给宽度和“margin: 0 auto”就行了。但在这里无法确定其宽度，所以这时这种方法就行不通了。</p>
<p><strong>解决方案一：相对浮动</strong></p>
<p>“.pagenavi ul” 向左浮动50%，是以外层“.pagenavi”的宽度为标准的；子节点“li”向右浮动50%，是以层“ul”的宽度为标准的，这里无需定义内层的宽度。这样算是一个小技巧，让“ul”居中了。也补足了float没有center属性的缺陷。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">.pagenavi</span><span style="color: Gray;"> </span><span style="color: Blue;">ul</span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Green;">float:</span><span style="color: Gray;"> </span><span style="color: Red;">left</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">left:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">50</span><span style="color: Red;">%</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">position:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">relative</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">.pagenavi</span><span style="color: Gray;"> </span><span style="color: Blue;">li</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">float:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">left</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">position:</span><span style="color: Gray;">&nbsp;</span><span style="color: Red;">relative</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">right:</span><span style="color: Gray;">&nbsp;</span><span style="color: Maroon;">50</span><span style="color: Red;">%</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li></ol></div>
<p><strong>解决方案二：display:inline-block</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">.pagenavi</span><span style="color: Gray;"> </span><span style="color: Blue;">li</span><span style="color: Olive;">{</span></li>
<li><span style="color: Green;">display:</span><span style="color: Red;">inline-block</span><span style="color: Gray;">;</span></li>
<li><span style="color: Blue;">*</span><span style="color: Green;">display:</span><span style="color: Red;">inline</span><span style="color: Gray;">;</span></li>
<li><span style="color: Blue;">*</span><span style="color: Green;">zoom:</span><span style="color: Maroon;">1</span><span style="color: Gray;">;</span></li>
<li><span style="color: Green;">vertical-align:</span><span style="color: Red;">top</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span><span style="color: Blue;">*</span><span style="color: Gray;">/</span></li></ol></div>
<p>详细的请点击下面的链接：</p>
<p><a href="http://leotheme.cn/wp-content/uploads/Example/css/dom-float-center.html">未知宽度容器的居中解决方案</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="解决wordpress分页问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-query-post-paged.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决wordpress分页问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE下中英文字体不能对齐原因及解决" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fiexiazywbunenduiji.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE下中英文字体不能对齐原因及解决</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Work it right tonight" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fmusci%2Fwork-it-right-tonight.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/04/17/19649313.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Work it right tonight</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Opera中国版开发代号：朱雀" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fnews%2Foperachina.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6200325.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Opera中国版开发代号：朱雀</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="黑莓主题的改版总算完成了" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fberrytimes-themes.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fdom-float-center.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196917.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">黑莓主题的改版总算完成了</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2008-11-25 -- <a href="http://leotheme.cn/javascript/css-clear-float-fangfa.html" title="CSS清除浮动的一些方法">CSS清除浮动的一些方法</a> (6)<br /><small>CSS的浮动为我们的布局带来了很大的好处，利用浮动我们可以很方便的写出各种版式。但浮动同时也带来很多问题；这些问题基本上都因为没有及时的或者在适当的位置清楚浮动。下面来说下常用的清除浮动方法：

...</small></li><li>2008-08-21 -- <a href="http://leotheme.cn/javascript/divmargin0autotext-align.html" title="DIV水平居中的方法小结">DIV水平居中的方法小结</a> (0)<br /><small>我想这个是我们经常遇到的一个问题，当然对很多人来说，这是个很简单，很容易解决的问，在这里我只是把这些常用的方总结下。
一、margin:auto 0 与 text-aligh:center
这个方...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/dom-float-center.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>JQ弹出层插件(tipsWindow 2.8)</title>
		<link>http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html</link>
		<comments>http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html#comments</comments>
		<pubDate>Wed, 24 Nov 2010 06:27:40 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[tipswindow]]></category>
		<category><![CDATA[弹出层]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=843</guid>
		<description><![CDATA[已更新为2.7<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery性能优化指南" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-xingnen-youhua.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery性能优化指南</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery实现背景图渐变切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197230.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery实现背景图渐变切换</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #008000;"><strong>有兴趣的同学请加群：166281776 一起交流</strong></span></p>
<p><strong>关于插件：</strong></p>
<p>已更新为2.8</p>
<p>一个基于jQuery的弹出层。最新版本2.8;</p>
<p>支持拖拽，支持多窗口。内容为文字，ID，图片，SWF，URL，框架；</p>
<p>这个插件前前后后修改了几个月了。一直在改进；到现在差不多了。以后不会经常更新了；</p>
<p>参数JS代码里已作注释，这里不再复述；所有参数都为可选。就这么多了；有问题大家留言或发邮件给我！</p>
<p><strong>更新：(2011-05-16)</strong></p>
<p>1. 已修复IE6下存在的问题；</p>
<p>2. 然后增强了随机生成的ID防重复；</p>
<p><span id="more-843"></span></p>
<p>3. 新增了一个获取当前弹出层ID的方法 $.XYTipsWindow.getID()；</p>
<p>4. 增加了ID判断，当传了ID的时候。只能弹出一个窗口；</p>
<p><strong>更新：(2011-01-27)</strong></p>
<p>1. 修复了IE下的fixed定位input type=text元素无法输入；</p>
<p>2. 重写了定位方法，参照floatDIV插件的定位方式；</p>
<p>3. 新增加了一个内容类型“swf”；</p>
<p>4. 新增对话模式(支持回调)；</p>
<p>5. 重写吸附模式定位；</p>
<p>6. 修复IE6下置底时仍可以往下拖动滚动条；</p>
<p>7. 新增“___windowBgColor”，“___windowBgOpacity” 两个参数用来设置遮罩层颜色和透明度；</p>
<p>8. 其他细节修改；</p>
<p>详细的看演示页吧：<a href="http://leotheme.cn/wp-content/uploads/Example/js/XYTipsWindow/v2.8/">http://leotheme.cn/wp-content/uploads/Example/js/XYTipsWindow/v2.8/</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="一个jQuery弹出层(tipsWindown)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindown.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一个jQuery弹出层(tipsWindown)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery性能优化指南" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-xingnen-youhua.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery性能优化指南</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery实现背景图渐变切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-dragoninteractive-navi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197230.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery实现背景图渐变切换</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009-11-25 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindown.html" title="一个jQuery弹出层(tipsWindown)">一个jQuery弹出层(tipsWindown)</a> (100)<br /><small>弹出层效果网上很多很多，也没啥好说的了。写这个只是作为学习JQ的一些记录。此插件的一些方法参考了花匠的dialog；在此表示感谢。
接着说说这种弹出层的原理或者说是做法。总结下经验；首先需要一个遮罩...</small></li><li>2011-09-08 -- <a href="http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html" title="jQuery中queue和dequeue的用法">jQuery中queue和dequeue的用法</a> (1)<br /><small>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...</small></li><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (19)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html" title="分享Flight主题中的焦点图（基于JQ）">分享Flight主题中的焦点图（基于JQ）</a> (22)<br /><small>关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html" title="jquery ajax方法如load,get等 在Chrome下失效的问题">jquery ajax方法如load,get等 在Chrome下失效的问题</a> (4)<br /><small>最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下：


function getHtml(url,ctner){
//alert(c...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html/feed</wfw:commentRss>
		<slash:comments>164</slash:comments>
		</item>
		<item>
		<title>分享Flight主题中的焦点图（基于JQ）</title>
		<link>http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html</link>
		<comments>http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html#comments</comments>
		<pubDate>Tue, 12 Oct 2010 13:05:24 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[ifocus]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[焦点图]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=838</guid>
		<description><![CDATA[关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动，淡入淡出）三种动画模式。可以设置执行时间。可以自定义大小，方便应用。可以选择是否自动切换。还是上代码吧。也没啥说的了。 /*参数： ------------------------------------------------------------------------ &#160; &#160; &#160; obj:&#160; &#160; 要切换的对像[ID,Class] animation:&#160; 设置切换方式 [left(向左滚动),top(向上滚动),fade(淡入淡出)] &#160; &#160;&#160; time:&#160; &#160; 设置每次动画执行间隔时间 [单位毫秒)] &#160; &#160; speed:&#160; &#160; 设置每次动画执行时间 [单位毫秒] &#160; &#160;&#160; auto:&#160; &#160; 设置是否显自动切换 [可选值为:true,false] &#160; cssName:&#160; 附加Class名称 [自定义焦点图容器样式,可以不填] ------------------------------------------------------------------------- //示例: ------------------------------------------------------------------------- &#60;div id=&#34;ifocus&#34;&#62; &#160; &#160; &#60;ul class=&#34;ifocus_list&#34;&#62; &#160; &#160; &#160; &#160; &#60;li&#62;&#60;a href=&#34;#1&#34;&#62;&#60;img src=&#34;images/01.png&#34; alt=&#34;图片1&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#160; &#160; &#160; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Flight主题更新" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fflight-update.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Flight主题更新</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：perfct 1.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-themes-perfct.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/22/33021700.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：perfct 1.0</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="EveryTime" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fmusci%2Feverytime.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">EveryTime</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress“主题壁纸”" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fshare%2Fwordpressthemedesk.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197177.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress“主题壁纸”</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="黑莓主题的改版总算完成了" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fberrytimes-themes.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196917.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">黑莓主题的改版总算完成了</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动，淡入淡出）三种动画模式。可以设置执行时间。可以自定义大小，方便应用。可以选择是否自动切换。还是上代码吧。也没啥说的了。<br />
<span id="more-838"></span></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">/*参数：</span></li>
<li><span style="color: #ffa500;">------------------------------------------------------------------------</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &nbsp; obj:&nbsp; &nbsp; 要切换的对像[ID,Class]</span></li>
<li><span style="color: #ffa500;">animation:&nbsp; 设置切换方式 [left(向左滚动),top(向上滚动),fade(淡入淡出)]</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp;&nbsp; time:&nbsp; &nbsp; 设置每次动画执行间隔时间 [单位毫秒)]</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; speed:&nbsp; &nbsp; 设置每次动画执行时间 [单位毫秒]</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp;&nbsp; auto:&nbsp; &nbsp; 设置是否显自动切换 [可选值为:true,false]</span></li>
<li><span style="color: #ffa500;">&nbsp; cssName:&nbsp; 附加Class名称 [自定义焦点图容器样式,可以不填]</span></li>
<li><span style="color: #ffa500;">-------------------------------------------------------------------------</span></li>
<li><span style="color: #ffa500;">//示例:</span></li>
<li><span style="color: #ffa500;">-------------------------------------------------------------------------</span></li>
<li><span style="color: #ffa500;">&lt;div id=&quot;ifocus&quot;&gt;</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &lt;ul class=&quot;ifocus_list&quot;&gt;</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#1&quot;&gt;&lt;img src=&quot;images/01.png&quot; alt=&quot;图片1&quot; /&gt;&lt;/a&gt;&lt;/li&gt;</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#2&quot;&gt;&lt;img src=&quot;images/02.png&quot; alt=&quot;图片2&quot; /&gt;&lt;/a&gt;&lt;/li&gt;</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#3&quot;&gt;&lt;img src=&quot;images/03.png&quot; alt=&quot;图片3&quot; /&gt;&lt;/a&gt;&lt;/li&gt;</span></li>
<li><span style="color: #ffa500;">&nbsp; &nbsp; &lt;/ul&gt;</span></li>
<li><span style="color: #ffa500;">&lt;/div&gt;</span></li>
<li><span style="color: #ffa500;">-------------------------------------------------------------------------</span></li>
<li><span style="color: #ffa500;">//example1.jQFocus(&quot;#ifocus&quot;,&quot;left&quot;,2000,500,true);</span></li>
<li><span style="color: #ffa500;">-------------------------------------------------------------------------</span></li>
<li><span style="color: #ffa500;">//example2.jQFocus(&quot;#ifocus&quot;,&quot;top&quot;,2000,500,true,&quot;border_red&quot;);</span></li>
<li><span style="color: #ffa500;">------------------------------------------------------------------------*/</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">jQFocus</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">,</span><span style="color: Blue;">animation</span><span style="color: Gray;">,</span><span style="color: Blue;">time</span><span style="color: Gray;">,</span><span style="color: Blue;">speed</span><span style="color: Gray;">,</span><span style="color: Blue;">auto</span><span style="color: Gray;">,</span><span style="color: Blue;">cssName</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">t</span><span style="color: Gray;"> = </span><span style="color: Blue;">n</span><span style="color: Gray;"> =</span><span style="color: Maroon;">0</span><span style="color: Gray;">,</span><span style="color: Blue;">li</span><span style="color: Gray;">=$</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">,</span><span style="color: Blue;">count</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">size</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">_width</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">width</span><span style="color: Olive;">()</span><span style="color: Gray;">,</span><span style="color: Blue;">_height</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">height</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">css</span><span style="color: Olive;">({</span><span style="color: Blue;">width</span><span style="color: Gray;">: </span><span style="color: Olive;">(</span><span style="color: Blue;">_width</span><span style="color: Olive;">)</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">px</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Blue;">height</span><span style="color: Gray;">:</span><span style="color: Blue;">_height</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">px</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">})</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">class</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Blue;">cssName</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">&lt;div class='ifocus_info'&gt;&lt;/div&gt;</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">appendTo</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">&lt;span class='ifocus_title'&gt;&lt;/span&gt;</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">appendTo</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">html</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.ifocus_list li:first-child</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">find</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">img</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">alt</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">num</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;ul class=&quot;ifocus_control&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">for</span><span style="color: Olive;">(</span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">i</span><span style="color: Gray;">=</span><span style="color: Maroon;">0</span><span style="color: Gray;">;</span><span style="color: Blue;">i</span><span style="color: Gray;">&lt;</span><span style="color: Blue;">count</span><span style="color: Gray;">;</span><span style="color: Blue;">i</span><span style="color: Gray;">++</span><span style="color: Olive;">){</span><span style="color: Blue;">num</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;li&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Olive;">(</span><span style="color: Blue;">i</span><span style="color: Gray;">+</span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/li&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">}</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">num</span><span style="color: Gray;">+=</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/ul&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">append</span><span style="color: Olive;">(</span><span style="color: Blue;">num</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_control li:first-child</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">addClass</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">current</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.ifocus_title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">click</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span><span style="color: Teal;">window</span><span style="color: Gray;">.</span><span style="color: Blue;">open</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.ifocus_list a:first-child</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">href</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">, </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">_blank</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_control li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">click</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">()</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">i</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">text</span><span style="color: Olive;">()</span><span style="color: Gray;"> - </span><span style="color: Maroon;">1</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">n</span><span style="color: Gray;"> = </span><span style="color: Blue;">i</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: Blue;">i</span><span style="color: Gray;"> &gt;= </span><span style="color: Blue;">count</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">return</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">animation</span><span style="color: Gray;"> = </span><span style="color: Blue;">animation</span><span style="color: Gray;">.</span><span style="color: Blue;">substring</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">switch</span><span style="color: Olive;">(</span><span style="color: Blue;">animation</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">case</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">left</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_list</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">css</span><span style="color: Olive;">({</span><span style="color: Blue;">width</span><span style="color: Gray;">:</span><span style="color: Olive;">(</span><span style="color: Blue;">_width</span><span style="color: Gray;">*</span><span style="color: Blue;">count</span><span style="color: Olive;">)</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">px</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Blue;">height</span><span style="color: Gray;">:</span><span style="color: Blue;">_height</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">px</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_list li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">css</span><span style="color: Olive;">({</span><span style="color: Green;">float</span><span style="color: Gray;">:</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">left</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Blue;">height</span><span style="color: Gray;">:</span><span style="color: Blue;">_height</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">px</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_list</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">animate</span><span style="color: Olive;">({</span><span style="color: Blue;">left</span><span style="color: Gray;">:-</span><span style="color: Olive;">(</span><span style="color: Blue;">_width</span><span style="color: Gray;">*</span><span style="color: Blue;">i</span><span style="color: Olive;">)}</span><span style="color: Gray;">,</span><span style="color: Blue;">speed</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">break</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">case</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">top</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_list</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">animate</span><span style="color: Olive;">({</span><span style="color: Blue;">top</span><span style="color: Gray;">:-</span><span style="color: Olive;">(</span><span style="color: Blue;">_height</span><span style="color: Gray;">*</span><span style="color: Blue;">i</span><span style="color: Olive;">)}</span><span style="color: Gray;">,</span><span style="color: Blue;">speed</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">break</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">case</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">fade</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_list li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">filter</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">:visible</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">fadeOut</span><span style="color: Olive;">(</span><span style="color: Blue;">speed</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">parent</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">eq</span><span style="color: Olive;">(</span><span style="color: Blue;">i</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">fadeIn</span><span style="color: Olive;">(</span><span style="color: Blue;">speed</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.ifocus_title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">html</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.ifocus_list a</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">eq</span><span style="color: Olive;">(</span><span style="color: Blue;">i</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">find</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">img</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">alt</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">addClass</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">current</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">siblings</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">removeClass</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">current</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Blue;">auto</span><span style="color: Gray;">==</span><span style="color: Green;">true</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">showAuto</span><span style="color: Gray;"> = </span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">n</span><span style="color: Gray;"> = </span><span style="color: Blue;">n</span><span style="color: Gray;"> &gt;= </span><span style="color: Olive;">(</span><span style="color: Blue;">count</span><span style="color: Gray;"> - </span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: Gray;"> ? </span><span style="color: Maroon;">0</span><span style="color: Gray;"> : ++</span><span style="color: Blue;">n</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .ifocus_control li</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">eq</span><span style="color: Olive;">(</span><span style="color: Blue;">n</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">trigger</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">click</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">t</span><span style="color: Gray;"> = </span><span style="color: Blue;">setInterval</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">showAuto()</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">, </span><span style="color: Blue;">time</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">obj</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">hover</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span><span style="color: Blue;">clearInterval</span><span style="color: Olive;">(</span><span style="color: Blue;">t</span><span style="color: Olive;">)}</span><span style="color: Gray;">, </span><span style="color: Green;">function</span><span style="color: Olive;">(){</span><span style="color: Blue;">t</span><span style="color: Gray;"> = </span><span style="color: Blue;">setInterval</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">showAuto()</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">, </span><span style="color: Blue;">time</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span><span style="color: Olive;">})</span><span style="color: Gray;">;&nbsp; &nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>对于代码这个也没啥说的了。会点JQ的能看懂。看不懂的我也说不明白。例子就在文章的头上；</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Flight主题更新" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fflight-update.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Flight主题更新</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：perfct 1.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-themes-perfct.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/22/33021700.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：perfct 1.0</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="EveryTime" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fmusci%2Feverytime.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">EveryTime</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress“主题壁纸”" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fshare%2Fwordpressthemedesk.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197177.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress“主题壁纸”</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="黑莓主题的改版总算完成了" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fberrytimes-themes.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fflight-theme-jquery-ifocus.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196917.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">黑莓主题的改版总算完成了</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2011-09-08 -- <a href="http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html" title="jQuery中queue和dequeue的用法">jQuery中queue和dequeue的用法</a> (1)<br /><small>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...</small></li><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (19)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-11-24 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html" title="JQ弹出层插件(tipsWindow 2.8)">JQ弹出层插件(tipsWindow 2.8)</a> (164)<br /><small>已更新为2.7...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html" title="jquery ajax方法如load,get等 在Chrome下失效的问题">jquery ajax方法如load,get等 在Chrome下失效的问题</a> (4)<br /><small>最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下：


function getHtml(url,ctner){
//alert(c...</small></li><li>2009-11-30 -- <a href="http://leotheme.cn/javascript/ajax-load-post-content.html" title="不刷新（AJAX）获取文章的内容">不刷新（AJAX）获取文章的内容</a> (53)<br /><small>相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>jquery ajax方法如load,get等 在Chrome下失效的问题</title>
		<link>http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html</link>
		<comments>http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html#comments</comments>
		<pubDate>Tue, 12 Oct 2010 00:09:07 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[load]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=835</guid>
		<description><![CDATA[最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下： function getHtml(url,ctner){ //alert(ctner); //$.get(url,function(data) {$(ctner).html(data);}, &#34;text&#34;); try{ $(ctner).load(url); } catch(e)&#160;{ alert(url + &#34;读取错误&#34;); } } 症状： 其实语句是执行了，如上面的代码，TRY的时候并没有抛出错误，但返回的内容就是空值。 百度了半天没发现解决方法。 后来GOOGLE了一下老外的内容，才发现问题的症结 http://forum.jquery.com/topic/load-and-ajax-not-working-on-google-chrome 原来是Chrome 5+里面对非针对服务端的Ajax调用做了严格的限制，如果是在SERVER端调用就没有问题了。。。。。。无语 作个记录。我昨正也遇到这个问题了； 原文：http://hi.baidu.com/barkbread/blog/item/acc0bdd4b786e70ca08bb73f.html 相关文章2009-11-30 -- 不刷新（AJAX）获取文章的内容 (53)相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲...2011-09-08 -- jQuery中queue和dequeue的用法 (1)今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...2011-08-17 -- Flight主题更新 (19)这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...2010-11-24 -- JQ弹出层插件(tipsWindow 2.8) (164)已更新为2.7...2010-10-12 -- 分享Flight主题中的焦点图（基于JQ） (22)关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动...<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="不刷新（AJAX）获取文章的内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196490.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">不刷新（AJAX）获取文章的内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery中queue和dequeue的用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery中queue和dequeue的用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="JQ弹出层插件(tipsWindow 2.8)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">JQ弹出层插件(tipsWindow 2.8)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">getHtml</span><span style="color: Olive;">(</span><span style="color: Blue;">url</span><span style="color: Gray;">,</span><span style="color: Blue;">ctner</span><span style="color: Olive;">){</span></li>
<li><span style="color: #ffa500;">//alert(ctner);</span></li>
<li><span style="color: #ffa500;">//$.get(url,function(data) {$(ctner).html(data);}, &quot;text&quot;);</span></li>
<li><span style="color: Green;">try</span><span style="color: Olive;">{</span><span style="color: Gray;"> $</span><span style="color: Olive;">(</span><span style="color: Blue;">ctner</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">load</span><span style="color: Olive;">(</span><span style="color: Blue;">url</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Green;">catch</span><span style="color: Olive;">(</span><span style="color: Blue;">e</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span><span style="color: Gray;"> </span><span style="color: Blue;">alert</span><span style="color: Olive;">(</span><span style="color: Blue;">url</span><span style="color: Gray;"> + </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">读取错误</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>症状： 其实语句是执行了，如上面的代码，TRY的时候并没有抛出错误，但返回的内容就是空值。</p>
<p>百度了半天没发现解决方法。 后来GOOGLE了一下老外的内容，才发现问题的症结<br />
<span id="more-835"></span><br />
<a href="http://forum.jquery.com/topic/load-and-ajax-not-working-on-google-chrome">http://forum.jquery.com/topic/load-and-ajax-not-working-on-google-chrome</a></p>
<p>原来是Chrome 5+里面对非针对服务端的Ajax调用做了严格的限制，如果是在SERVER端调用就没有问题了。。。。。。无语</p>
<p>作个记录。我昨正也遇到这个问题了；</p>
<p>原文：<a href="http://hi.baidu.com/barkbread/blog/item/acc0bdd4b786e70ca08bb73f.html">http://hi.baidu.com/barkbread/blog/item/acc0bdd4b786e70ca08bb73f.html</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="不刷新（AJAX）获取文章的内容" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6196490.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">不刷新（AJAX）获取文章的内容</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery中queue和dequeue的用法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery%25E4%25B8%25ADqueue%25E5%2592%258Cdequeue%25E7%259A%2584%25E7%2594%25A8%25E6%25B3%2595.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery中queue和dequeue的用法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery 实现 tab 切换一例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-tab.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197250.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery 实现 tab 切换一例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用jquery写一个简单的菜单伸缩效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-for-nav-slide.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197279.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用jquery写一个简单的菜单伸缩效果</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="JQ弹出层插件(tipsWindow 2.8)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-plugins-tipswindow-2-0.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">JQ弹出层插件(tipsWindow 2.8)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009-11-30 -- <a href="http://leotheme.cn/javascript/ajax-load-post-content.html" title="不刷新（AJAX）获取文章的内容">不刷新（AJAX）获取文章的内容</a> (53)<br /><small>相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲...</small></li><li>2011-09-08 -- <a href="http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html" title="jQuery中queue和dequeue的用法">jQuery中queue和dequeue的用法</a> (1)<br /><small>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...</small></li><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (19)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-11-24 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html" title="JQ弹出层插件(tipsWindow 2.8)">JQ弹出层插件(tipsWindow 2.8)</a> (164)<br /><small>已更新为2.7...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html" title="分享Flight主题中的焦点图（基于JQ）">分享Flight主题中的焦点图（基于JQ）</a> (22)<br /><small>关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>firefox与ie 的javascript区别</title>
		<link>http://leotheme.cn/javascript/firefox-and-ie-javascript.html</link>
		<comments>http://leotheme.cn/javascript/firefox-and-ie-javascript.html#comments</comments>
		<pubDate>Tue, 10 Aug 2010 14:09:02 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=792</guid>
		<description><![CDATA[浏览器的兼容问题目前还是一个头痛的问题。除了CSS的兼容性，Javascript的兼容有时候更容易让人头痛。下面收集的一些关于Firefox和IE的区别作个记号，需要的时候看看 1. Document.form.item 问题 现有问题： 现有代码中存在许多 document.formName.item(“itemName”) 这样的语句，不能在 firefox下运行 解决方法： 改用 document.formName.elements["elementName"] 2. 集合类对象问题 现有问题： 现有代码中许多集合类对象取用时使用 ()，IE 能接受，firefox 不能。 解决方法： 改用 [] 作为下标运算。如：document.forms(“formName”) 改为 document.forms["formName"]。 又如：document.getElementsByName(“inputName”)(1) 改为 document.getElementsByName(“inputName”)[1] 3. window.event (1)现有问题： 使用 window.event 无法在 mf 上运行 (2)解决方法： mf 的 event 只能在事件发生的现场使用，此问题暂无法解决。可以这样变通： 原代码(可在ie中运行)： 原代码(可在IE中运行)： &#60;input type=&#34;button&#34; name=&#34;someButton&#34; value=&#34;提交&#34; onclick=&#34;javascript:gotoSubmit()&#34;/&#62;&#160;&#160; &#160; &#160; &#160; &#160; &#160;...&#160;&#160; &#160; &#160; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="能支持IE6的前端更牛，还是敢对IE6说不的更牛？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-must-die.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197236.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">能支持IE6的前端更牛，还是敢对IE6说不的更牛？</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="最佳网页IE浏览器兼容性测试工具(IE6 IE7 IE8共存)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fietester.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6199374.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">最佳网页IE浏览器兼容性测试工具(IE6 IE7 IE8共存)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6因为编码问题无法正确解析CSS文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-css-zhusi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6因为编码问题无法正确解析CSS文件</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="鼠标滚轮缩放图象兼容[IE、FF、Opera]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fsbglsufangimagesize.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">鼠标滚轮缩放图象兼容[IE、FF、Opera]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS样式中class和id的区别和含义" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fstyleforcssandidequbie.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS样式中class和id的区别和含义</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>浏览器的兼容问题目前还是一个头痛的问题。除了CSS的兼容性，Javascript的兼容有时候更容易让人头痛。下面收集的一些关于Firefox和IE的区别作个记号，需要的时候看看</p>
<p><strong>1. Document.form.item 问题</strong><br />
    现有问题：<br />
       现有代码中存在许多 document.formName.item(“itemName”) 这样的语句，不能在 firefox下运行<br />
 <span id="more-792"></span><br />
    解决方法：<br />
        改用 document.formName.elements["elementName"]</p>
<p><strong>2. 集合类对象问题</strong><br />
    现有问题：<br />
        现有代码中许多集合类对象取用时使用 ()，IE 能接受，firefox 不能。<br />
    解决方法：<br />
        改用 [] 作为下标运算。如：document.forms(“formName”) 改为 document.forms["formName"]。<br />
        又如：document.getElementsByName(“inputName”)(1) 改为 document.getElementsByName(“inputName”)[1]</p>
<p><strong>3. window.event</strong><br />
    (1)现有问题：<br />
使用 <code>window.event </code>无法在 mf 上运行<br />
(2)解决方法：<br />
mf 的 <code>event</code> 只能在事件发生的现场使用，此问题暂无法解决。可以这样变通：<br />
原代码(可在ie中运行)：<br />
        原代码(可在IE中运行)：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">&lt;</span><span style="color: Blue;">input</span><span style="color: Gray;"> </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">button</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">name</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">someButton</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">value</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">提交</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">onclick</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">javascript:gotoSubmit()</span><span style="color: #8b0000;">&quot;/</span><span style="color: Red;">&gt;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;script language=&quot;javascript&quot;&gt;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;function gotoSubmit() {<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert(window.event);&nbsp; &nbsp; </span><span style="color: #8b0000;">//</span><span style="color: Red;"> use window.event<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;</span><span style="color: #8b0000;">/</span><span style="color: Blue;">script</span><span style="color: Gray;">&gt;</span></div></div>
<p>        新代码(可在IE和MF中运行)：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">&lt;</span><span style="color: Blue;">input</span><span style="color: Gray;"> </span><span style="color: Blue;">type</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">button</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">name</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">someButton</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">value</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">提交</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">onclick</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">javascript:gotoSubmit(event)</span><span style="color: #8b0000;">&quot;/</span><span style="color: Red;">&gt;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;script language=&quot;javascript&quot;&gt;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;function gotoSubmit(evt) {<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;evt = evt ? evt : (window.event ? window.event : null);<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert(evt);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #8b0000;">//</span><span style="color: Red;"> use evt<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;</span><span style="color: #8b0000;">/</span><span style="color: Blue;">script</span><span style="color: Gray;">&gt;</span></div></div>
<p>        此外，如果新代码中第一行不改，与老代码一样的话(即 gotoSubmit 调用没有给参数)，则仍然只能在IE中运行，但不会出错。所以，这种方案 tpl 部分仍与老代码兼容。</p>
<p><strong>4. HTML 对象的 id 作为对象名的问题</strong><br />
    现有问题<br />
        在 IE 中，HTML 对象的 ID 可以作为 document 的下属对象变量名直接使用。在 firefox 中不能。<br />
    解决方法<br />
        用 getElementById(“idName”) 代替 idName 作为对象变量使用。</p>
<p><strong>5. 用idName字符串取得对象的问题</strong><br />
    现有问题<br />
        在IE中，利用 eval(idName) 可以取得 id 为 idName 的 HTML 对象，在MF 中不能。<br />
    解决方法<br />
        用 getElementById(idName) 代替 eval(idName)。</p>
<p><strong>6. 变量名与某 HTML 对象 id 相同的问题</strong><br />
    现有问题<br />
        在 MF 中，因为对象 id 不作为 HTML 对象的名称，所以可以使用与 HTML 对象 id 相同的变量名，IE 中不能。<br />
    解决方法<br />
        在声明变量时，一律加上 var ，以避免歧义，这样在 IE 中亦可正常运行。<br />
        此外，最好不要取与 HTML 对象 id 相同的变量名，以减少错误。</p>
<p><strong>7. event.x 与 event.y 问题</strong><br />
    现有问题<br />
        在IE 中，event 对象有 x, y 属性，MF中没有。<br />
    解决方法<br />
        在MF中，与event.x 等效的是 event.pageX。但event.pageX IE中没有。<br />
        故采用 event.clientX 代替 event.x。在IE 中也有这个变量。<br />
        event.clientX 与 event.pageX 有微妙的差别（当整个页面有滚动条的时候），不过大多数时候是等效的。</p>
<p>        如果要完全一样，可以稍麻烦些：<br />
        mX = event.x ? event.x : event.pageX;<br />
        然后用 mX 代替 event.x<br />
    其它<br />
        event.layerX 在 IE 与 MF 中都有，具体意义有无差别尚未试验。</p>
<p> <strong>8. 关于frame</strong><br />
   现有问题<br />
         在 IE中 可以用window.testFrame取得该frame，mf中不行<br />
   解决方法<br />
         在frame的使用方面mf和ie的最主要的区别是：<br />
如果在frame标签中书写了以下属性：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">frame</span><span style="color: Gray;"> </span><span style="color: #00008b;">src</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">xx.htm</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">id</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">frameId</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">name</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">frameName</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Olive;">/&gt;</span></div></div>
<p>那么ie可以通过id或者name访问这个frame对应的window对象<br />
而mf只可以通过name来访问这个frame对应的window对象<br />
例如如果上述frame标签写在最上层的window里面的htm里面，那么可以这样访问<br />
ie： window.top.frameId或者window.top.frameName来访问这个window对象<br />
mf： 只能这样window.top.frameName来访问这个window对象</p>
<p>另外，在mf和ie中都可以使用window.top.document.getElementById(“frameId”)来访问frame标签<br />
并且可以通过window.top.document.getElementById(“testFrame”).src = &#8216;xx.htm&#8217;来切换frame的内容<br />
也都可以通过window.top.frameName.location = &#8216;xx.htm&#8217;来切换frame的内容<br />
关于frame和window的描述可以参见bbs的‘window与frame’文章<br />
以及/test/js/test_frame/目录下面的测试</p>
<p><strong>9. 在mf中，自己定义的属性必须getAttribute()取得</strong><br />
<strong>10.在mf中没有 parentElement parement.children 而用 parentNode parentNode.childNodes</strong><br />
   childNodes的下标的含义在IE和MF中不同，MF使用DOM规范，childNodes中会插入空白文本节点。一般可以通过node.getElementsByTagName()来回避这个问题。 当html中节点缺失时，IE和MF对parentNode的解释不同，例如</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Olive;">&lt;</span><span style="color: Green;">form</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">table</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">input</span><span style="color: Olive;">/&gt;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">table</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">form</span><span style="color: Olive;">&gt;</span></li></ol></div>
<p>   MF中input.parentNode的值为form, 而IE中input.parentNode的值为空节点</p>
<p> MF中节点没有removeNode方法，必须使用如下方法 node.parentNode.removeChild(node)</p>
<p><strong>11.const 问题</strong><br />
 现有问题:<br />
     在 IE 中不能使用 const 关键字。如 const constVar = 32; 在IE中这是语法错误。<br />
 解决方法:<br />
     不使用 const ，以 var 代替。</p>
<p><strong>12. body 对象</strong><br />
   MF的body在body标签没有被浏览器完全读入之前就存在，而IE则必须在body完全被读入之后才存在</p>
<p><strong>13. url encoding</strong><br />
在js中如果书写url就直接写&#038;不要写&amp;例如var url = &#8216;xx.jsp?objectName=xx&amp;objectEvent=xxx&#8217;;<br />
frm.action = url那么很有可能url不会被正常显示以至于参数没有正确的传到服务器<br />
一般会服务器报错参数没有找到<br />
当然如果是在tpl中例外，因为tpl中符合xml规范，要求&#038;书写为&amp;<br />
一般MF无法识别js中的&amp;</p>
<p><strong>14. nodeName 和 tagName 问题</strong><br />
 现有问题：<br />
     在MF中，所有节点均有 nodeName 值，但 textNode 没有 tagName 值。在 IE 中，nodeName 的使用好象<br />
     有问题（具体情况没有测试，但我的IE已经死了好几次）。<br />
 解决方法：<br />
     使用 tagName，但应检测其是否为空。</p>
<p><strong>15. 元素属性</strong><br />
   IE下 input.type属性为只读，但是MF下可以修改</p>
<p><strong>16. document.getElementsByName() 和 document.all[name] 的问题</strong><br />
 现有问题：<br />
     在 IE 中，getElementsByName()、document.all[name] 均不能用来取得 div 元素（是否还有其它不能取的元素还不知道）。</p>
<p> <strong>17. 对象问题</strong><br />
1.1 Form对象<br />
现有问题：<br />
现有代码这获得form对象通过document.forms(“formName”)，这样使用在IE 能接受，MF 不能。<br />
解决方法：<br />
改用 作为下标运算。改为document.forms["formName"]<br />
备注<br />
上述的改用 作为下标运算中的formName是id而name</p>
<p>1.2 HTML对象<br />
现有问题：<br />
在 IE 中，HTML 对象的 ID 可以作为 document 的下属对象变量名直接使用。在 MF 中不能。<br />
document.all(“itemName”)或者document.all(“itemId”)<br />
解决方法：<br />
使用对象ID作为对象变量名<br />
<code>document.getElementById("itemId")</code><br />
备注<br />
document.all是IE自定义的方法，所以请大家尽量不使用。<br />
还有一种方式，在IE和MF都可以使用<br />
<code>var f = document.forms["formName "];<br />
var o = f. itemId;</code></p>
<p>1.3 DIV对象<br />
现有问题：<br />
在 IE 中，DIV对象可以使用ID作为对象变量名直接使用。在 MF 中不能。<br />
DivId.style.display = “none”<br />
解决方法：<br />
document.getElementById(“DivId”).style.display = “none”<br />
备注<br />
获得对象的方法不管是不是DIV对象，都使用getElementById方法。参见1.2</p>
<p>1.4 关于frame<br />
现有问题<br />
在 IE中 可以用window.testFrame取得该frame，mf中不行<br />
解决方法<br />
在frame的使用方面MF和IE的最主要的区别是：<br />
如果在frame标签中书写了以下属性：</p>
<p>那么IE可以通过id或者name访问这个frame对应的window对象<br />
而mf只可以通过name来访问这个frame对应的window对象<br />
例如如果上述frame标签写在最上层的window里面的htm里面，那么可以这样访问<br />
IE： window.top.frameId或者window.top.frameName来访问这个window对象<br />
MF：只能这样window.top.frameName来访问这个window对象<br />
另外，在mf和ie中都可以使用window.top.document.getElementById(“frameId”)来访问frame标签<br />
并且可以通过window.top.document.getElementById(“testFrame”).src = &#8216;xx.htm&#8217;来切换frame的内容<br />
也都可以通过window.top.frameName.location = &#8216;xx.htm&#8217;来切换frame的内容</p>
<p>1.5 窗口<br />
现有问题<br />
IE中可以通过showModalDialog和showModelessDialog打开模态和非模态窗口，但是MF不支持。<br />
解决办法<br />
直接使用window.open(pageURL,name,parameters)方式打开新窗口。<br />
如果需要传递参数，可以使用frame或者iframe。</p>
<p>2. 总结<br />
2.1 在JS中定义各种对象变量名时，尽量使用id，避免使用name。<br />
在 IE 中，HTML 对象的 ID 可以作为 document 的下属对象变量名直接使用。在 MF 中不能，所以在平常使用时请尽量使用id，避免只使用name，而不使用id。</p>
<p>2.2 变量名与某 HTML 对象 id 相同的问题<br />
现有问题<br />
在 MF 中，因为对象 id 不作为 HTML 对象的名称，所以可以使用与 HTML 对象 id 相同的变量名，IE 中不能。<br />
解决方法<br />
在声明变量时，一律加上 var ，以避免歧义，这样在 IE 中亦可正常运行。<br />
此外，最好不要取与 HTML 对象 id 相同的变量名，以减少错误。</p>
<p>1. document.all<br />
 Firefox可以兼容document.all， 但会生成一条警告。可以用getElementById(“*”) 或者 getElementByTagName(“*)来代替<br />
 不过对于document.all.length等属性，则完全不兼容。<br />
2. parentElement<br />
 这个也不兼容。比方说， obj.parentElement.name 则应改成 obj.parentNode.attributes.getNamedItem(“name”).nodeValue （不知道如何写得更简洁些）<br />
3. event<br />
 W3C不支持windows.event<br />
 比方说:<br />
    在IE里面</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">div</span><span style="color: Gray;"> </span><span style="color: #00008b;">class</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">menu</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">id</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">menu</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">onclick</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">onMenuClick(); </span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">.....</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">div</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp;function onMenuClick()<br />&nbsp;&nbsp; &nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;collapseMenu(event.srcElement);<br />&nbsp;&nbsp; &nbsp; &nbsp;}</span></div></div>
<p>    工作正常。不过在Firefox中，则改成：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">div</span><span style="color: Gray;"> </span><span style="color: #00008b;">class</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">menu</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">id</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">menu</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">onclick</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">onMenuClick(event); </span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;function onMenuClick(evt)<br />&nbsp;&nbsp; &nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(evt == null)<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;evt = window.event; // For IE<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var srcElement = evt.srcElement? evt.srcElement : evt.target; // IE使用srcElement, 而Firefox使用target<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;collapseMenu(srcElement);<br />}</span></div></div>
<p>1：innerText<br />
IE支持，FIREFOX不支持<br />
解决办法：用innerHTML,2种浏览器都识别innerHTML</p>
<p>2：document.createElement<br />
document.appendChild<br />
在往表里插入行时<br />
FIREFOX支持，IE不支持<br />
解决办法：把行插入到TBODY中，不要直接插入到表</p>
<p>3：setAttribute(&#8216;style&#8217;,'color:red;&#8217;)<br />
FIREFOX支持(除了IE，现在所有浏览器都支持)，IE不支持<br />
解决办法：不用setAttribute(&#8216;style&#8217;,'color:red&#8217;)<br />
而用object.style.cssText = &#8216;color:red;&#8217;(这写法也有例外)<br />
最好的办法是上面种方法都用上，万无一失 ^_^<br />
4:class<br />
setAttribute(&#8216;class&#8217;,'styleClass&#8217;)<br />
FIREFOX支持，IE不支持(指定属性名为CLASS，IE不会设置元素的CLASS属性，相反只使用SETATTRIBUTE时IE自动识别CLASSNAME属性)<br />
解决办法：<br />
setAttribute(&#8216;class&#8217;,'styleClass&#8217;)<br />
setAttribute(&#8216;className&#8217;,'styleClass&#8217;)<br />
2种都用上</p>
<p>5:用setAttribute设置事件<br />
var obj = document.getElementById(&#8216;objId&#8217;);<br />
obj.setAttribute(&#8216;onclick&#8217;,'funcitonname();&#8217;);<br />
FIREFOX支持，IE不支持<br />
解决办法：<br />
IE中必须用点记法来引用所需的事件处理程序,并且要用赋予匿名函数<br />
如下：<br />
var obj = document.getElementById(&#8216;objId&#8217;);<br />
obj.onclick=function(){fucntionname();};<br />
这种方法所有浏览器都支持</p>
<p>6：建立单选钮<br />
IE以外的浏览器</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">rdo</span><span style="color: Gray;"> = </span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">input</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Blue;">rdo</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">type</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">radio</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Blue;">rdo</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">name</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">radiobtn</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Blue;">rdo</span><span style="color: Gray;">.</span><span style="color: Blue;">setAttribute</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">value</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">checked</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></div></div>
<p>IE:</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">rdo</span><span style="color: Gray;"> =</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: Blue;">createElement</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">&lt;input type='radio' name='radiobtn' value='checked'&gt;</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></div></div>
<p>解决办法：<br />
这一点区别和前面的都不一样。这次完全不同，所以找不到共同的办法来解决，那么只有IF-ELSE了<br />
万幸的是，IE可以识别出document的uniqueID属性，别的浏览器都不可以识别出这一属性。问题解决。</p>
<p>0：共同的一些技巧<br />
在动态建立INPUT型输入元素时，一般是先加入，在设置TYPE。这就有可能出错</p>
<p>好习惯：<code>var btn = document.createElement('input');<br />
btn.setAttribut('type','button');<br />
document.getElementById('formId').appendChild(btn);</code></p>
<p>来源于：http://blog.csdn.net/zqian1987/archive/2008/03/02/2140055.aspx</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="能支持IE6的前端更牛，还是敢对IE6说不的更牛？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-must-die.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6197236.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">能支持IE6的前端更牛，还是敢对IE6说不的更牛？</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="最佳网页IE浏览器兼容性测试工具(IE6 IE7 IE8共存)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fietester.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6199374.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">最佳网页IE浏览器兼容性测试工具(IE6 IE7 IE8共存)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IE6因为编码问题无法正确解析CSS文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fie6-css-zhusi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IE6因为编码问题无法正确解析CSS文件</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="鼠标滚轮缩放图象兼容[IE、FF、Opera]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fsbglsufangimagesize.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">鼠标滚轮缩放图象兼容[IE、FF、Opera]</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS样式中class和id的区别和含义" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fstyleforcssandidequbie.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Ffirefox-and-ie-javascript.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS样式中class和id的区别和含义</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009-06-03 -- <a href="http://leotheme.cn/javascript/css-auto-for-br.html" title="CSS实现自动换行的小技巧">CSS实现自动换行的小技巧</a> (4)<br /><small>大家都知道连续的英文或数字能是容器被撑大，不能根据容器的大小自动换行，下面是 CSS如何将他们换行的方法！

对于div

1.（IE浏览器）white-space:normal; word-...</small></li><li>2009-08-30 -- <a href="http://leotheme.cn/javascript/css-3-0-chm.html" title="CSS 3.0 参考手册 (中文版)">CSS 3.0 参考手册 (中文版)</a> (9)<br /><small>作为一个Web开发者，保持对未来Web标准的关注、学习和了解是很重要的。不管你是第一次准备去认识CSS3，还是已经略知皮毛，这个来自腾讯的webteam发布的CSS 3.0 参考手册 (中文版)将有助...</small></li><li>2009-07-24 -- <a href="http://leotheme.cn/javascript/ie6-must-die.html" title="能支持IE6的前端更牛，还是敢对IE6说不的更牛？">能支持IE6的前端更牛，还是敢对IE6说不的更牛？</a> (27)<br /><small>作为一个前端，是能够支持更多的浏览器比较牛，还是勇于对IE6说不，更牛一些呢？IE6在其特定历史时期内起到了举足轻重的作用。而如今，是时候让他寿终正寝，离开历史舞台的时候了，他却欲罢还休不离不弃。面对...</small></li><li>2009-06-11 -- <a href="http://leotheme.cn/javascript/jquery-tab.html" title="jQuery 实现 tab 切换一例">jQuery 实现 tab 切换一例</a> (11)<br /><small>对于Tab切换，我想大家都不陌生了。现在几乎是到处可见了；今天为大家介绍下怎么用jQuery来实现一个简单的Tab切换效果。其实这类例子网上也有很多了，在这里不讨论它的实现原理，因为都是些最基本的应用...</small></li><li>2009-05-27 -- <a href="http://leotheme.cn/javascript/jquery-xingnen-youhua.html" title="jQuery性能优化指南">jQuery性能优化指南</a> (6)<br /><small>现在jquery应用的越来越多, 有些同学在享受爽快淋漓coding时就将性能问题忽略了,  比如我.  jquery虽在诸多的js类库中性能表现还算优秀, 但毕竟不是在用原生的javascript开...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/firefox-and-ie-javascript.html/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>不刷新（AJAX）获取文章的内容</title>
		<link>http://leotheme.cn/javascript/ajax-load-post-content.html</link>
		<comments>http://leotheme.cn/javascript/ajax-load-post-content.html#comments</comments>
		<pubDate>Mon, 30 Nov 2009 15:27:19 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[前端交互]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[WP相关]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=782</guid>
		<description><![CDATA[相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲解。在这想跟大家分享下。AJAX加载文章的内容。当然，这里还是基于JQ的load方法来实现。OK，来看效果： 首先，定义三个变量： var objTag= $(&#34;.post&#34;);//定义要获取内容所在的节点 var&#160;num= objTag.length;//定义节点的数量 var&#160;_cache=new Object;//建立一个缓存对像 然后构建一个加载的函数： function loadentry(n){ &#160; &#160; var&#160;_url=$(objTag[n]).children(&#34;.archive-post-title&#34;).children(&#34;h2&#34;).children(&#34;a&#34;).attr(&#34;href&#34;);//定义要加载文章的地址 &#160; &#160; $('&#60;div class=&#34;details&#34;&#62;&#60;div style=&#34;width:160px;margin-top:8px;padding:0 2px;font-size:12px;background: #01E343; color:#FFF;&#34;&#62;正在加载文章内容，请稍等！&#60;/div&#62;&#60;/div&#62;').insertBefore($(objTag[n]).children(&#34;.singledata&#34;));//插入提示信息 &#160; &#160; if(_cache[_url]==null){//判断是否有缓存 &#160; &#160; &#160; &#160; $(objTag[n]).children(&#34;.details&#34;).load(_url+&#34; .post .entry&#34;,function(){ &#160; &#160; &#160; &#160; &#160; &#160; _cache[_url]=$(objTag[n]).children(&#34;.details&#34;).html(); &#160; &#160; &#160; &#160; &#160; &#160; $('&#60;span class=&#34;archive-arrow&#34;&#62;&#60;span title=&#34;收起全文&#34; class=&#34;hide fRight&#34; onclick=&#34;closentry(&#38;quot;'+n+'&#38;quot;);&#34;&#62;收起全文↑&#60;/span&#62;&#60;/span&#62;').insertAfter($(objTag[n]).children(&#34;.details&#34;)); &#160; &#160; &#160; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fclick-title-display-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">简单几步显示/隐藏文章内容</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jquery ajax方法如load,get等 在Chrome下失效的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Jsonp 方式跨域获取 json 数据</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fwordpress-bookmarkandshare.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">AddThis——为你的文章添加一个Share按钮</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fothes%2Flaogonghelaopodegushi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">说真的，这篇文章很有”意思”？！</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>相信大家都知道AJAX评论这玩意。AJAX评论带来了很多好处，不用在刷新页面就能发表评论。实时提交，实时显示。很多人都用上了都给自己的BLOG上添加了这样的功能。方法在这就不说了，很多人都作了详细的讲解。在这想跟大家分享下。AJAX加载文章的内容。当然，这里还是基于JQ的load方法来实现。OK，来看效果：<br />
<span id="more-782"></span><br />
<img src="http://leotheme.cn/wp-content/uploads/2009/11/load1.png" alt="load1" title="load1" width="503" height="91" class="alignnone size-full wp-image-783" /></p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/11/load2.png" alt="load2" title="load2" width="535" height="99" class="alignnone size-full wp-image-784" /></p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/11/load3.png" alt="load3" title="load3" width="471" height="109" class="alignnone size-full wp-image-785" /></p>
<p>首先，定义三个变量：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">objTag</span><span style="color: Gray;">= $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.post</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//定义要获取内容所在的节点</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">num</span><span style="color: Gray;">= </span><span style="color: Blue;">objTag</span><span style="color: Gray;">.</span><span style="color: Blue;">length</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//定义节点的数量</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">_cache</span><span style="color: Gray;">=</span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">Object</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//建立一个缓存对像</span></li></ol></div>
<p>然后构建一个加载的函数：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">loadentry</span><span style="color: Olive;">(</span><span style="color: Blue;">n</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">_url</span><span style="color: Gray;">=$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-post-title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">h2</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">a</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">href</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//定义要加载文章的地址</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;div class=&quot;details&quot;&gt;&lt;div style=&quot;width:160px;margin-top:8px;padding:0 2px;font-size:12px;background: #01E343; color:#FFF;&quot;&gt;正在加载文章内容，请稍等！&lt;/div&gt;&lt;/div&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertBefore</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.singledata</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//插入提示信息</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Blue;">_cache</span><span style="color: Olive;">[</span><span style="color: Blue;">_url</span><span style="color: Olive;">]</span><span style="color: Gray;">==</span><span style="color: Green;">null</span><span style="color: Olive;">){</span><span style="color: #ffa500;">//判断是否有缓存</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">load</span><span style="color: Olive;">(</span><span style="color: Blue;">_url</span><span style="color: Gray;">+</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> .post .entry</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">_cache</span><span style="color: Olive;">[</span><span style="color: Blue;">_url</span><span style="color: Olive;">]</span><span style="color: Gray;">=$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">html</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;archive-arrow&quot;&gt;&lt;span title=&quot;收起全文&quot; class=&quot;hide fRight&quot; onclick=&quot;closentry(&amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">n</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;quot;);&quot;&gt;收起全文↑&lt;/span&gt;&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//加载文章内容</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span><span style="color: Green;">else</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-post-title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-arrow</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">html</span><span style="color: Olive;">(</span><span style="color: Blue;">_cache</span><span style="color: Olive;">[</span><span style="color: Blue;">_url</span><span style="color: Olive;">])</span><span style="color: Gray;">;</span><span style="color: #ffa500;">//直接显示缓存对像的内容</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;archive-arrow&quot;&gt;&lt;span title=&quot;收起全文&quot; class=&quot;hide fRight&quot; onclick=&quot;closentry(&amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">n</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;quot;);&quot;&gt;收起全文↑&lt;/span&gt;&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-post-title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-arrow</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>这部分对于不懂JQ的人来说可能有点复杂。懂JQ的人看起来一定很简单。就是一个对DOM的操作。通过动态的插入清除节点来实现我们需要的效果。关健在于“.load()”的用法。</p>
<p>到这已经实现了加载了。接着需要做个删除也就是收起全文；相比加载，删除要简单的多了，就是直接删除节点就行了。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">closentry</span><span style="color: Olive;">(</span><span style="color: Blue;">n</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.details</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">animate</span><span style="color: Olive;">({</span><span style="color: Blue;">height</span><span style="color: Gray;">: </span><span style="color: #8b0000;">'</span><span style="color: Red;">toggle</span><span style="color: #8b0000;">'</span><span style="color: Olive;">}</span><span style="color: Gray;">, </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">slow</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()})</span><span style="color: Gray;">; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-arrow</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;div class=&quot;archive-arrow&quot;&gt;&lt;span title=&quot;阅读全文&quot; class=&quot;show&quot; onclick=&quot;loadentry(&amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">n</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;quot;);&quot;&gt;阅读全文↓&lt;/span&gt;&lt;/div&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">n</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-post-title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">p</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li></ol></div>
<p>这段代码就是一个基本的节点操作。在这就不作说明了；当然，最后我们需要插入节点并绑定事件。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Teal;">document</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">ready</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">for</span><span style="color: Olive;">(</span><span style="color: Blue;">a</span><span style="color: Gray;">=</span><span style="color: Maroon;">0</span><span style="color: Gray;">;</span><span style="color: Blue;">a</span><span style="color: Gray;">&lt;</span><span style="color: Blue;">num</span><span style="color: Gray;">;</span><span style="color: Blue;">a</span><span style="color: Gray;">++</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objTag</span><span style="color: Olive;">[</span><span style="color: Blue;">a</span><span style="color: Olive;">])</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-post-title</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">children</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.archive-arrow</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">append</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;show&quot; title=&quot;阅读全文&quot; onclick=&quot;loadentry(&amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">a</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;quot;);&quot;&gt;阅读全文↓&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li></ol></div>
<p>OK，到这里这个AJAX加载效果就完成了。详细的效果可以点击侧边栏的分类导航。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fclick-title-display-content.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">简单几步显示/隐藏文章内容</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjquery-ajax-load-get-in-chrome.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">jquery ajax方法如load,get等 在Chrome下失效的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fjsonp-get-json-data.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Jsonp 方式跨域获取 json 数据</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fwordpress-bookmarkandshare.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">AddThis——为你的文章添加一个Share按钮</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fothes%2Flaogonghelaopodegushi.html&from=http%3A%2F%2Fleotheme.cn%2Fjavascript%2Fajax-load-post-content.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">说真的，这篇文章很有”意思”？！</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/jquery-ajax-load-get-in-chrome.html" title="jquery ajax方法如load,get等 在Chrome下失效的问题">jquery ajax方法如load,get等 在Chrome下失效的问题</a> (4)<br /><small>最近碰到一个问题，发现jquery在chrome 中， ajax的load get等方法完全失效。 代码如下：


function getHtml(url,ctner){
//alert(c...</small></li><li>2008-11-27 -- <a href="http://leotheme.cn/javascript/add-login-window-at-sidebar.html" title="给你的侧边栏添加一个登陆入口">给你的侧边栏添加一个登陆入口</a> (12)<br /><small>个人一直觉得wordpress的登陆很麻烦，要打开一个新窗口才行。而且默认的那个窗口看起来并不怎么漂亮。所以决定给它整整，搞个适合偶主题的登陆框才行。之前我已经写过一篇文章，但那个是用jQuery实现...</small></li><li>2008-09-15 -- <a href="http://leotheme.cn/javascript/jqueryforwpgoodtwo.html" title="jquery基础教程二[伸缩、隔行变色...]">jquery基础教程二[伸缩、隔行变色...]</a> (3)<br /><small>在上一篇介绍中已经讲了一些基本的应用，今天继续。先看一下面这个例子
Demo_5：收缩展开功能[如无法运行请多刷新几次或保存到本地运行]

 
 
 
 
可伸缩块 

 
p,d...</small></li><li>2008-09-11 -- <a href="http://leotheme.cn/javascript/jqueryforwpgoodone.html" title="jquery基础教程一[click,addClass,show,hide]">jquery基础教程一[click,addClass,show,hide]</a> (3)<br /><small>原创内容—转载请说明出处.

jQuery我想很多人都知道，但用WP的好像很少有人说到这个。今天开始和大家一起来研究下如何用jQuery来为我们的WP添加实用的功能。至于jQuery的相关背景和资...</small></li><li>2008-08-28 -- <a href="http://leotheme.cn/wordpress/wordpressjs-jqueryone.html" title="利用WP自带的JS库打造超酷的侧边栏">利用WP自带的JS库打造超酷的侧边栏</a> (6)<br /><small>从这篇文章开始，我们来认识下wordpress自带的JS库，下面这张图是WP自动的JS文件夹。可以看出有很多JS文件，当然包括大名鼎鼎的jquery和prototype。利用这些我们能实现很多很酷的效...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/javascript/ajax-load-post-content.html/feed</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>WordPress评论表单验证</title>
		<link>http://leotheme.cn/wordpress/wordpress-comment-form-proof.html</link>
		<comments>http://leotheme.cn/wordpress/wordpress-comment-form-proof.html#comments</comments>
		<pubDate>Sat, 28 Nov 2009 02:50:40 +0000</pubDate>
		<dc:creator>Await</dc:creator>
				<category><![CDATA[WP相关]]></category>
		<category><![CDATA[前端交互]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[表单]]></category>
		<category><![CDATA[评论]]></category>
		<category><![CDATA[验证]]></category>

		<guid isPermaLink="false">http://leotheme.cn/?p=772</guid>
		<description><![CDATA[wordpress的评论只是个很简单的表单。WP本身也有一个自身的验证系统。但自带的这个验证是基于后台的验证。当表单不符合规格时跳转到另一个页面。我们需要返回上一页才能继续填写表单。这样对于用户的体验并不友好；所以一个基于前端的验证很需要。大家平时也一定有见过各种各样的表单验证。有些表单的验证很复杂，也很强大。不过WP的验证很简单。只需要验证“昵称”、“E-mail”、和评论就行了。http地址因为不是必须的。所以只需要在用户有输入的情况下判断下地址是否符合正常的格式就行了。来看下这个简单的验证效果： 下面来说说这个简单的表单验证。当然，还是基于jQuery的。 var Msg = new Array( &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#34;用户名不能为空&#34;, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#34;昵称不能少于3个字符&#34;, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#34;E-mail地址不能为空&#34;, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#34;请输入正确的E-Mail地址&#34;, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#34;url地址不正确&#34;, &#160; &#160; &#160; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="解决wordpress分页问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-query-post-paged.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决wordpress分页问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：perfct 1.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fothes%2Fwordpress-themes-perfct.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/22/33021700.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：perfct 1.0</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress定制首页输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-customize-homepage.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress定制首页输出</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress模板常用调用函数" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpresscyfunction.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress模板常用调用函数</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题之Maxthon 2.0.2[08-08-11]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpressthememaxthon202.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6198872.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题之Maxthon 2.0.2[08-08-11]</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>wordpress的评论只是个很简单的表单。WP本身也有一个自身的验证系统。但自带的这个验证是基于后台的验证。当表单不符合规格时跳转到另一个页面。我们需要返回上一页才能继续填写表单。这样对于用户的体验并不友好；所以一个基于前端的验证很需要。大家平时也一定有见过各种各样的表单验证。有些表单的验证很复杂，也很强大。不过WP的验证很简单。只需要验证“昵称”、“E-mail”、和评论就行了。http地址因为不是必须的。所以只需要在用户有输入的情况下判断下地址是否符合正常的格式就行了。来看下这个简单的验证效果：<br />
<span id="more-772"></span><br />
<img src="http://leotheme.cn/wp-content/uploads/2009/11/form1.png" alt="form1" title="form1" width="589" height="134" /></p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/11/form2.png" alt="form2" title="form2" width="590" height="137" /></p>
<p><img src="http://leotheme.cn/wp-content/uploads/2009/11/form3.png" alt="form3" title="form3" width="588" height="135" /><br />
下面来说说这个简单的表单验证。当然，还是基于jQuery的。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">Msg</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Teal;">Array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">用户名不能为空</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">昵称不能少于3个字符</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">E-mail地址不能为空</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">请输入正确的E-Mail地址</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">url地址不正确</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">评论内容不能少于5个字符</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">输入正确</span><span style="color: #8b0000;">&quot;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div>
<p>首先定义一个提示信息的数组。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;"> $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">is</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">#author</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">next</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Gray;">==</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onError&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">0</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Gray;">.</span><span style="color: Blue;">length</span><span style="color: Gray;"> &lt; </span><span style="color: Maroon;">3</span><span style="color: Gray;"> </span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onError&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">1</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onok&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">6</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li></ol></div>
<p>验证昵称：如果用户输入的字符为空，或少于3个。刚显示相应的错误信息，否则显示输入正确。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">//验证邮件地址</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;"> $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">is</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">#email</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">next</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Gray;">==</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onError&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">2</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Gray;">!=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> &amp;&amp; !</span><span style="color: #8b0000;">/</span><span style="color: Red;">^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$</span><span style="color: #8b0000;">/</span><span style="color: Gray;">.</span><span style="color: Blue;">test</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Olive;">)){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onError&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">3</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onok&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">6</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li></ol></div>
<p>验证E-mail地址：和验证昵称一样。这里是用正则去匹配地址是否正确；</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">//验证url</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;"> $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">is</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">#url</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">next</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Gray;">!=</span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;"> &amp;&amp; !</span><span style="color: #8b0000;">/</span><span style="color: Red;">^http:</span><span style="color: Navy;">\/\/</span><span style="color: Red;">[A-Za-z0-9]+\.[A-Za-z0-9]+[</span><span style="color: Navy;">\/</span><span style="color: Red;">=\?%\-&amp;_~`@[\]\':+!]*([^&lt;&gt;\&quot;\&quot;])*$</span><span style="color: #8b0000;">/</span><span style="color: Gray;">.</span><span style="color: Blue;">test</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Gray;">.</span><span style="color: Blue;">value</span><span style="color: Olive;">)){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;span class=&quot;formtips onok&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">+</span><span style="color: Blue;">Msg</span><span style="color: Olive;">[</span><span style="color: Maroon;">4</span><span style="color: Olive;">]</span><span style="color: Gray;">+</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/span&gt;</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">insertAfter</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li></ol></div>
<p>验证url地址，因为这个不是必须的，所以只在有输入的情况下才去判断地址是否正确</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">//提交，最终验证</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">#submit</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">click</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">#commentform :input</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">trigger</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">blur</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;">//验证评论内容</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Gray;"> $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">textarea</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">val</span><span style="color: Olive;">()</span><span style="color: Gray;"> == </span><span style="color: #8b0000;">&quot;&quot;</span><span style="color: Gray;">|| $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">textarea</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">val</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: Blue;">length</span><span style="color: Gray;"> &lt; </span><span style="color: Maroon;">5</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">tipsWindown</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">提示</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text:评论内容不能为空或少于5个字符!</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">250</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">150</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">2000</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">msg</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">return</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">false</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">numError</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">form .onError</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">length</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Blue;">numError</span><span style="color: Olive;">){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">tipsWindown</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">提示</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text:请正确填写表单内容</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">250</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">150</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">2000</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">msg</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">return</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">false</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span><span style="color: Green;">else</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">tipsWindown</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">提示</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text:正在提交评论...</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">250</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">150</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">2000</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">false</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">msg</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">.formtips</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">remove</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li></ol></div>
<p>最后。绑定事件，然后验证评论内容是否为空或小于5个字符。如果为true则弹出提示层，并阻止表单的提交。否则弹出提示：正在提交评论&#8230;然后清除提示信息；OK，一个基于JQ的简单的表单验证完成了；</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="解决wordpress分页问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-query-post-paged.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">解决wordpress分页问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题：perfct 1.0" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fothes%2Fwordpress-themes-perfct.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/22/33021700.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题：perfct 1.0</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="wordpress定制首页输出" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-customize-homepage.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">wordpress定制首页输出</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress模板常用调用函数" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpresscyfunction.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress模板常用调用函数</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress主题之Maxthon 2.0.2[08-08-11]" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpressthememaxthon202.html&from=http%3A%2F%2Fleotheme.cn%2Fwordpress%2Fwordpress-comment-form-proof.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/22/6198872.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress主题之Maxthon 2.0.2[08-08-11]</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2008-09-15 -- <a href="http://leotheme.cn/javascript/jqueryforwpgoodtwo.html" title="jquery基础教程二[伸缩、隔行变色...]">jquery基础教程二[伸缩、隔行变色...]</a> (3)<br /><small>在上一篇介绍中已经讲了一些基本的应用，今天继续。先看一下面这个例子
Demo_5：收缩展开功能[如无法运行请多刷新几次或保存到本地运行]

 
 
 
 
可伸缩块 

 
p,d...</small></li><li>2011-09-08 -- <a href="http://leotheme.cn/javascript/jquery%e4%b8%adqueue%e5%92%8cdequeue%e7%9a%84%e7%94%a8%e6%b3%95.html" title="jQuery中queue和dequeue的用法">jQuery中queue和dequeue的用法</a> (1)<br /><small>今天在做右下角那个静止的工具栏时遇到了一个问题。鼠标放上去的时候，要让周围的4个按钮按顺序显示出来，移开的时候要按顺序隐藏。左思右想发现用animate的回调函数方式来写比较麻烦。于是百度了下，发现j...</small></li><li>2011-08-17 -- <a href="http://leotheme.cn/wordpress/flight-update.html" title="Flight主题更新">Flight主题更新</a> (19)<br /><small>这几天收到有些童鞋反应主题在wp3.2版本后台不能快速编缉文章，不能上传图片。抽空看了下，是JQ库版本冲突引起，现已更新。请移步到wopus主题站下载更新后的版本。也可以通过115网盘下载。...</small></li><li>2010-11-24 -- <a href="http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html" title="JQ弹出层插件(tipsWindow 2.8)">JQ弹出层插件(tipsWindow 2.8)</a> (164)<br /><small>已更新为2.7...</small></li><li>2010-10-12 -- <a href="http://leotheme.cn/javascript/flight-theme-jquery-ifocus.html" title="分享Flight主题中的焦点图（基于JQ）">分享Flight主题中的焦点图（基于JQ）</a> (22)<br /><small>关于这个焦点图没啥说的了，网上太多了。但自己一直没找到个合适的。现在的这个是Dreamy主题中的升级版，虽然看起来一模一样。其实做了很多扩展，优化了结构和JS部分。可以选择切换方式（左右滚动，上下滚动...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://leotheme.cn/wordpress/wordpress-comment-form-proof.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

