<?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>Alan&#039;s World</title>
	<atom:link href="http://www.alanoy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alanoy.com</link>
	<description>Do what you want to do</description>
	<lastBuildDate>Thu, 02 Sep 2010 16:29:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>jQuery 实现网页选项卡</title>
		<link>http://www.alanoy.com/jquery-tab/</link>
		<comments>http://www.alanoy.com/jquery-tab/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:31:14 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Note]]></category>
		<category><![CDATA[Tab]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=265</guid>
		<description><![CDATA[很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集成一栏，然后用选项卡的方式展现出来，节省空间，方便访问者浏览。于是就想到要自己写个 jQuery 代码来实现。 HTML 和 CSS 代码这里略过，可以查看 Demo。jQuery 代码如下： 123456789101112131415161718jQuery&#40;function&#40;$&#41; &#123; &#160; &#160; //给当前要显示的标题添加类 selected，然后在它后面插入其他项的标题。 &#160; &#160; $&#40;'.tab_fst h2'&#41;.addClass&#40;'selected'&#41;.after&#40;$&#40;'.tab_sec h2'&#41;, $&#40;'.tab_trd h2'&#41;&#41;; &#160; &#160; //把其他选项的内容插到第一个选项的内容的后面并隐藏。 &#160; &#160; $&#40;'.tab_content:gt(0)'&#41;.insertAfter&#40;'.tab_content:eq(0)'&#41;.hide&#40;&#41;; &#160; &#160; //上面代码执行后，会留下两个空的 div，用 .remove() 方法删掉。 &#160; &#160; $&#40;'.tab_sec, .tab_trd'&#41;.remove&#40;&#41;; &#160; &#160; //首先给选项卡的标题增加类 title，以便我们修改美化标题栏的样式； &#160; &#160; //然后添加点击每个标题的效果。 &#160; &#160; $&#40;'.tab_fst h2'&#41;.addClass&#40;'title'&#41;.click&#40;function&#40;&#41; &#123; &#160; &#160; &#160; &#160; //给被点击的标题添加类 [...]]]></description>
			<content:encoded><![CDATA[<p>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集成一栏，然后用选项卡的方式展现出来，节省空间，方便访问者浏览。于是就想到要自己写个 jQuery 代码来实现。<span id="more-265"></span></p>
<p><abbr title="Hypertext Markup Language">HTML</abbr> 和 <abbr title="Cascading Style Sheets">CSS</abbr> 代码这里略过，可以查看 <a href="http://www.alanoy.com/example/jquery-tab.html" title="jQuery 网页选项卡">Demo</a>。jQuery 代码如下：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">jQuery<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//给当前要显示的标题添加类 selected，然后在它后面插入其他项的标题。</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_fst h2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_sec h2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_trd h2'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//把其他选项的内容插到第一个选项的内容的后面并隐藏。</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_content:gt(0)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">insertAfter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_content:eq(0)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//上面代码执行后，会留下两个空的 div，用 .remove() 方法删掉。</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_sec, .tab_trd'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//首先给选项卡的标题增加类 title，以便我们修改美化标题栏的样式；</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//然后添加点击每个标题的效果。</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_fst h2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//给被点击的标题添加类 selected，并移除其他标题项的 selected 类。</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//因为每个标题 h2 对应着相应的内容 tab_content，所以用变量 i 获取 h2 的索引</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_fst h2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//让被点击选项的内容显示，隐藏其他项。</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tab_content'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.tab_content&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>如果第一项后面有很多项，而你只想实现三个选项卡，那 <code class="codecolorer text dawn codes"><span class="text">$('.tab_content:gt(0)')</span></code> 这里就要改一下。</p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/jquery-dropdown-list/" title="jQuery 实现下拉菜单方法">jQuery 实现下拉菜单方法</a> (20)<br /><small>用 JavaScript 或是 jQuery 实现下拉菜单的方法很多人都讨论过了，对我而言是算一个笔...</small></li><li><a href="http://www.alanoy.com/jquery-multi-dropdown-list/" title="jQuery 实现多级下拉菜单">jQuery 实现多级下拉菜单</a> (8)<br /><small>在上篇文章 jQuery 实现下拉菜单方法 中写的代码仅仅是一级下拉菜单的情况，QiQiBoy 提了...</small></li><li><a href="http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/" title="jQuery 隐藏老用户评论资料框">jQuery 隐藏老用户评论资料框</a> (10)<br /><small>之前一直用的是 xiaorsz 的方法来隐藏老用户评论资料框，包括我发布的 DarkLight 和 ...</small></li><li><a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/" title="DarkLight和G-White主题的图片透明效果和超链接背景">DarkLight和G-White主题的图片透明效果和超链接背景</a> (10)<br /><small>DarkLight 和 G-White 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如...</small></li><li><a href="http://www.alanoy.com/wordpress-gravatar-cache/" title="Wordpress Gravatar 头像缓存">Wordpress Gravatar 头像缓存</a> (17)<br /><small>最近 Gravatar 头像老是显示不能，google 之得一好方法。来自 Willin 方法，将 ...</small></li><li><a href="http://www.alanoy.com/use-photo-to-replace-the-text-logo/" title="用图片替换文字Logo">用图片替换文字Logo</a> (15)<br /><small>用自制的图片来做博客的 Logo 相对文字 Logo 来说更美观、更多自定义性，鉴于 DarkLig...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/jquery-tab/">Permalink</a> |
<a href="http://www.alanoy.com/jquery-tab/#comments">26 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/jquery-tab/&title=jQuery 实现网页选项卡">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/jquery-tab/&title=jQuery 实现网页选项卡" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/jquery-tab/&title=jQuery 实现网页选项卡" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/jquery-tab/&title=jQuery 实现网页选项卡" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/jquery-tab/&title=jQuery 实现网页选项卡" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/jquery/" rel="tag">jQuery</a>, <a href="http://www.alanoy.com/tag/note/" rel="tag">Note</a>, <a href="http://www.alanoy.com/tag/tab/" rel="tag">Tab</a>, <a href="http://www.alanoy.com/tag/tutorial/" rel="tag">Tutorial</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/jquery-tab/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>WordPress主题：DarkLight 3.0</title>
		<link>http://www.alanoy.com/wordpress-theme-darklight-3/</link>
		<comments>http://www.alanoy.com/wordpress-theme-darklight-3/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 11:04:12 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[DarkLight]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=230</guid>
		<description><![CDATA[当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Ten 真是一个强大的主题，DarkLight 3.0 主题的功能基本与其保持一致。外观上基本保持 DarkLight 原有风格，换了些小图标，用了 Sprites 集成图片，技术一般，有点乱，不过不影响主题使用就是了。下面来个图文并茂的介绍。 首先 Header 部分： 相对之前的主题，导航栏这次用 jQuery 实现多级菜单，样式相对改进了，增加 box-show 效果（IE 不会有这个效果），包括侧边栏，如果有多级菜单的话，也加了这个效果，当然，你不要的话可以自己去掉；主题支持 WordPress 3.0 的菜单功能，Twenty Ten 自带有了。 其次是内容部分： 把之前使用内嵌的 wp-pagenavi 插件函数换成 willin 的 Mini Pagenavi，更加小巧，样式有轻微改动。 单篇文章中显示上一篇文章和下一篇文章的链接，在顶部和底部都有，这是 Twenty Ten 原来有的，我也保留了，不需要删除掉也比较简单。 相关文章本来想内嵌使用 willin 的方法，但还是放弃，不过样式还是保留在 style.css 文件里面，而且用 jQuery 实现类斑马纹样式，同样保留 js 代码，无论你用什么方法实现相关文章，只要给标题添加类 class=&#34;related_post_title&#34;，给列表 ul 或者 ol 添加类 class=&#34;related_post&#34;，那效果就类似下图： 作者信息栏，这个也是 Twenty Ten 自带，只要文章发布者有关于自己的描述说明，那么就会在文章底部显示作者信息，并可以点击链接查看该作者的全部文章。对于单人博客来说没啥用，如果多人参与的话，那相当有必要： 第三是评论部分： [...]]]></description>
			<content:encoded><![CDATA[<p>当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Ten 真是一个强大的主题，DarkLight 3.0 主题的功能基本与其保持一致。外观上基本保持 DarkLight 原有风格，换了些小图标，用了 Sprites 集成图片，技术一般，有点乱，不过不影响主题使用就是了。下面来个图文并茂的介绍。<span id="more-230"></span></p>
<h4>首先 Header 部分：</h4>
<p>相对之前的主题，导航栏这次用 jQuery 实现多级菜单，样式相对改进了，增加 <code class="codecolorer text dawn codes"><span class="text">box-show</span></code> 效果（IE 不会有这个效果），包括侧边栏，如果有多级菜单的话，也加了这个效果，当然，你不要的话可以自己去掉；主题支持 WordPress 3.0 的菜单功能，Twenty Ten 自带有了。</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/header.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/header.png" alt="Header Nav Menu" title="导航栏用jQuery实现多级下拉菜单" width="500" height="140" class="alignnone size-full wp-image-231" /></a></p>
<h4>其次是内容部分：</h4>
<p>把之前使用内嵌的 wp-pagenavi 插件函数换成 willin 的 <a href="http://kan.willin.org/?p=1323" rel="nofollow external">Mini Pagenavi</a>，更加小巧，样式有轻微改动。</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/pagenavi.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/pagenavi.png" alt="Mini Pagenavi" title="Mini Pagenavi" width="300" height="86" class="alignnone size-full wp-image-232" /></a></p>
<p>单篇文章中显示上一篇文章和下一篇文章的链接，在顶部和底部都有，这是 Twenty Ten 原来有的，我也保留了，不需要删除掉也比较简单。</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/post-navigation.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/post-navigation.png" alt="Posts Navigation" title="Posts Navigation" width="500" height="99" class="alignnone size-full wp-image-233" /></a></p>
<p>相关文章本来想内嵌使用 willin 的方法，但还是放弃，不过样式还是保留在 <em>style.css</em> 文件里面，而且用 jQuery 实现类斑马纹样式，同样保留 js 代码，无论你用什么方法实现相关文章，只要给标题添加类 <code class="codecolorer text dawn codes"><span class="text">class=&quot;related_post_title&quot;</span></code>，给列表 <code class="codecolorer text dawn codes"><span class="text">ul</span></code> 或者 <code class="codecolorer text dawn codes"><span class="text">ol</span></code> 添加类 <code class="codecolorer text dawn codes"><span class="text">class=&quot;related_post&quot;</span></code>，那效果就类似下图：</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/related-posts.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/related-posts.png" alt="Related Posts" title="相关文章样式" width="500" height="145" class="alignnone size-full wp-image-234" /></a></p>
<p>作者信息栏，这个也是 Twenty Ten 自带，只要文章发布者有关于自己的描述说明，那么就会在文章底部显示作者信息，并可以点击链接查看该作者的全部文章。对于单人博客来说没啥用，如果多人参与的话，那相当有必要：</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/about-author.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/about-author.png" alt="About the Author" title="作者信息" width="500" height="105" class="alignnone size-full wp-image-235" /></a></p>
<h4>第三是评论部分：</h4>
<p>首先是评论样式，重新设计了评论样式，奇数评论层跟偶数层样式不同，然后内嵌回复部分使用左右对话框样式，依然只支持嵌套 3 层，复杂的样式设计多层，挺累人的，代码也会复杂；同时还有评论楼层，只显示主评论楼层，具体看图：</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/comments-style.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/comments-style.png" alt="评论样式" title="评论样式" width="500" height="446" class="alignnone size-full wp-image-236" /></a></p>
<p>然后是 Ajax comment，使用的是 willin 的版本，然后 jQuery 增加 @reply，即点击回复会自动添加 <em>@somebody: </em>，还有 Ctrl+Enter 回复评论，隐藏回访用户资料框等常用功能。</p>
<h4>最后是 sidebar 和 footer 部分：</h4>
<p>这里似乎没什么好说的，因为用的 Twenty Ten 的结构，所以你完全可以使用主题的小工具来设置侧边栏，样式上不会存在问题，如果有那应该是我没有测试到吧。不仅侧边栏可以使用小工具，底部 footer 也可以：</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/08/footer.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/footer.png" alt="页脚" title="页脚的 Widget 功能" width="500" height="163" class="alignnone size-full wp-image-237" /></a></p>
<p>至于返回顶部的 <em>Go Top</em>，像之前说的，我并没有打算给它加上 js 滚动效果，不过样式上做了下改动而已。</p>
<h4>其他：</h4>
<p>主题支持 Opera 10，Firefox 3.0，Chrome，IE8，IE7，IE6，手头没 Safari，没测试；Doctype 由 HTML5 改成 XHTML 1.0 Traditional；主题不能通过 CCS 3 验证，因为圆角和阴影效果的缘故，也不能通过 HTML 验证，因为 Twenty Ten 用了 HTML5 的 <code class="codecolorer text dawn codes"><span class="text">role</span></code> 属性，我也懒得去全部改掉了；关于 CSS Sprites，把很多图片弄成一张，省去加载多张图片的时间；然后我又去掉了 Twenty Ten 原有支持的单栏样式；测试时间并不长，所以可能还有一些细节上或者其他问题，请 DarkLight 3.0 使用者帮忙汇报 Bug，谢谢！</p>
<p>最后的最后，再次声明，DarkLight 3.0 主题是基于 Twenty Ten 主题，请遵循<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow">署名-非商业性使用-相同方式共享 3.0.0  共享协议</a>，去掉 footer 版权信息的朋友请自重，不要连 WordPress 的也搞掉吧。</p>
<ol class="update">
<li>2010-9-2：给正文增加 <em>overflow: hidden</em> 属性，避免溢出情况；修正“您的评论正在等待审核”评论的位置。</li>
<li>2010-08-29 早上更新：居然忘记测试 404 页面，稍微修改了下，并且增加一个说明文件。</li>
<li>2010-08-29 下午更新：修改 IE6、IE7 下鼠标滑过文章标题时，文章背景线显示不全的问题；修改 IE6 下，鼠标滑过文章内链接时，文章分割线下滑问题，IE 实在太囧了；修改在回复评论时，第二层回复者名字的显示位置；修改成功提交评论后，增加提示评论成功的句子的左边距，保持美感，汗。</li>
</ol>
<p>演示：<a href='http://www.alanoy.com/?theme=DarkLight+3.0&#038;passkey=8993360444c6f9714c842a' title="Live Demo">Live Demo</a><br />
<a href='http://www.alanoy.com/wp-content/uploads/2010/08/darklight.zip' title="Wordpress Theme DarkLight 3.0">下载 WordPress 主题：DarkLight 3.0</a></p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/about-new-darklight-theme/" title="关于DarkLight主题新版本的开发">关于DarkLight主题新版本的开发</a> (18)<br /><small>在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结...</small></li><li><a href="http://www.alanoy.com/darklight-2-3/" title="DarkLight 2.3">DarkLight 2.3</a> (107)<br /><small>这两天开始动手修改 G-White 主题，很多东西修改，还是比较麻烦的，费了不少时间，然后在各浏览器...</small></li><li><a href="http://www.alanoy.com/darklight-2/" title="DarkLight 2.0">DarkLight 2.0</a> (128)<br /><small>DarkLight 2.0 终于如期发布，上个版本 1.04 直接跳到 2.0，改了挺多东西的，优化...</small></li><li><a href="http://www.alanoy.com/new-born/" title="New Born">New Born</a> (26)<br /><small>A new start for Alan’s World，以前的文章全部删了，这在从 PJ Blog...</small></li><li><a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/" title="DarkLight和G-White主题的图片透明效果和超链接背景">DarkLight和G-White主题的图片透明效果和超链接背景</a> (10)<br /><small>DarkLight 和 G-White 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/wordpress-theme-darklight-3/">Permalink</a> |
<a href="http://www.alanoy.com/wordpress-theme-darklight-3/#comments">56 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/wordpress-theme-darklight-3/&title=WordPress主题：DarkLight 3.0">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/wordpress-theme-darklight-3/&title=WordPress主题：DarkLight 3.0" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/wordpress-theme-darklight-3/&title=WordPress主题：DarkLight 3.0" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/wordpress-theme-darklight-3/&title=WordPress主题：DarkLight 3.0" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/wordpress-theme-darklight-3/&title=WordPress主题：DarkLight 3.0" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/darklight/" rel="tag">DarkLight</a>, <a href="http://www.alanoy.com/tag/wordpress/" rel="tag">Wordpress</a>, <a href="http://www.alanoy.com/tag/wordpress-theme/" rel="tag">Wordpress Theme</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/wordpress-theme-darklight-3/feed/</wfw:commentRss>
		<slash:comments>56</slash:comments>
		</item>
		<item>
		<title>jQuery 实现多级下拉菜单</title>
		<link>http://www.alanoy.com/jquery-multi-dropdown-list/</link>
		<comments>http://www.alanoy.com/jquery-multi-dropdown-list/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 16:00:49 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuory]]></category>
		<category><![CDATA[Note]]></category>
		<category><![CDATA[下拉菜单]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=228</guid>
		<description><![CDATA[在上篇文章 jQuery 实现下拉菜单方法 中写的代码仅仅是一级下拉菜单的情况，QiQiBoy 提了一下，想想是啊，因为自己平时博客中导航菜单都没有设置子菜单，就算本地测试的博客也只是设了一级菜单而已，已经成为惯性了。于是找了个时间再测试一下多级菜单的情况下，jQuery 的实现多级下拉菜单的方法。 相对前一篇的一级菜单，实现多级下拉菜单只要增加使用 .each() 方法。具体 jQuery 代码如下： 12345678910$&#40;document&#41;.ready&#40;function&#40;&#41; &#123; &#160; &#160; $&#40;&#34;#nav li ul.children&#34;&#41;.hide&#40;&#41;; &#160; &#160; &#160; &#160; $&#40;&#34;#nav li &#62; ul.children&#34;&#41;.each&#40;function&#40;&#41; &#123; &#160; &#160; &#160; &#160; $&#40;this&#41;.parent&#40;&#34;li&#34;&#41;.hover&#40;function&#40;&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; $&#40;this&#41;.children&#40;&#34;.children:not(:animated)&#34;&#41;.animate&#40;&#123;opacity: &#34;show&#34;, height: &#34;show&#34;&#125;, &#34;slow&#34;&#41;; &#160; &#160; &#160; &#160; &#125;, function&#40;&#41; &#123; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>在上篇文章 <a href="http://www.alanoy.com/jquery-dropdown-list/" title="jQuery 实现下拉菜单方法">jQuery 实现下拉菜单方法</a> 中写的代码仅仅是一级下拉菜单的情况，<a href="http://www.qiqiboy.com/" rel="external nofollow">QiQiBoy</a> 提了一下，想想是啊，因为自己平时博客中导航菜单都没有设置子菜单，就算本地测试的博客也只是设了一级菜单而已，已经成为惯性了。于是找了个时间再测试一下多级菜单的情况下，jQuery 的实现多级下拉菜单的方法。<span id="more-228"></span></p>
<p>相对前一篇的一级菜单，实现多级下拉菜单只要增加使用 <code class="codecolorer text dawn codes"><span class="text">.each()</span></code> 方法。具体 jQuery 代码如下：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav li ul.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav li &gt; ul.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children:not(:animated)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>看看 <a href="http://www.alanoy.com/example/dropdownlist/jquery-multi-dropdown-list.html" rel="nofollow">Demo</a> 最后一个菜单 Title5 的效果。</p>
<p>还可以做一下扩展，不要把下拉菜单限定在导航菜单上，让其他带有子菜单的菜单都能实现这效果：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> showChild<span style="color: #009900;">&#40;</span>menu<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; menu.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; menu.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul:not(:animated)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">//调用 showChild() 函数。</span><br />
showChild<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>比如想实现侧边栏的分类菜单下拉效果，加多一行类似 <code class="codecolorer text dawn codes"><span class="text">showChild($(&quot;#categories&quot;));</span></code> 的就行了，看你具体的 ID 或是类标签的设置了。</p>
<p><del datetime="2010-08-27T12:57:10+00:00">目前 IE6 和 IE7 下有问题。</del> IE 问题解决，其实不关 jQuery 代码问题，是我 CSS 代码没写好。</p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/jquery-dropdown-list/" title="jQuery 实现下拉菜单方法">jQuery 实现下拉菜单方法</a> (20)<br /><small>用 JavaScript 或是 jQuery 实现下拉菜单的方法很多人都讨论过了，对我而言是算一个笔...</small></li><li><a href="http://www.alanoy.com/jquery-tab/" title="jQuery 实现网页选项卡">jQuery 实现网页选项卡</a> (26)<br /><small>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集...</small></li><li><a href="http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/" title="jQuery 隐藏老用户评论资料框">jQuery 隐藏老用户评论资料框</a> (10)<br /><small>之前一直用的是 xiaorsz 的方法来隐藏老用户评论资料框，包括我发布的 DarkLight 和 ...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/jquery-multi-dropdown-list/">Permalink</a> |
<a href="http://www.alanoy.com/jquery-multi-dropdown-list/#comments">8 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/jquery-multi-dropdown-list/&title=jQuery 实现多级下拉菜单">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/jquery-multi-dropdown-list/&title=jQuery 实现多级下拉菜单" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/jquery-multi-dropdown-list/&title=jQuery 实现多级下拉菜单" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/jquery-multi-dropdown-list/&title=jQuery 实现多级下拉菜单" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/jquery-multi-dropdown-list/&title=jQuery 实现多级下拉菜单" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/jquory/" rel="tag">jQuory</a>, <a href="http://www.alanoy.com/tag/note/" rel="tag">Note</a>, <a href="http://www.alanoy.com/tag/%e4%b8%8b%e6%8b%89%e8%8f%9c%e5%8d%95/" rel="tag">下拉菜单</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/jquery-multi-dropdown-list/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>jQuery 实现下拉菜单方法</title>
		<link>http://www.alanoy.com/jquery-dropdown-list/</link>
		<comments>http://www.alanoy.com/jquery-dropdown-list/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 00:00:05 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Note]]></category>
		<category><![CDATA[下拉菜单]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=226</guid>
		<description><![CDATA[用 JavaScript 或是 jQuery 实现下拉菜单的方法很多人都讨论过了，对我而言是算一个笔记，也算是在写主题中遇到的问题拿出来说一说吧。以前写主题很少对下拉菜单下过功夫，就算到后来也只是用 CSS 写，没有动画效果，而且在 IE6 下是不会有显示的，在写 DarkLight 3.0 的时候，想用 jQuery 实现下拉菜单，然后遇到点问题。 我开始是这样写代码的（下拉+淡入淡出效果）： 1234567jQuery&#40;document&#41;.ready&#40;function&#40;$&#41; &#123; &#160; &#160; $&#40;&#34;#nav &#62; li&#34;&#41;.hover&#40;function&#40;&#41; &#123; &#160; &#160; &#160; &#160; $&#40;this&#41;.children&#40;&#34;.children&#34;&#41;.animate&#40;&#123;opacity: &#34;show&#34;, height: &#34;show&#34;&#125;, &#34;slow&#34;&#41;; &#160; &#160; &#125;, function&#40;&#41; &#123; &#160; &#160; &#160; &#160; $&#40;this&#41;.children&#40;&#34;.children&#34;&#41;.animate&#40;&#123;opacity: &#34;hide&#34;, height: &#34;hide&#34;&#125;, &#34;100&#34;&#41;; &#160; &#160; &#125;&#41;; &#125;&#41;; 然后问题出现了，看 Demo，但鼠标滑过菜单，然后向下滑的时候，下拉菜单在不断的重复向上向下的淡入淡出动作。用 .stop() 方法行不通，google 之，在 [...]]]></description>
			<content:encoded><![CDATA[<p>用 JavaScript 或是 jQuery 实现下拉菜单的方法很多人都讨论过了，对我而言是算一个笔记，也算是在写主题中遇到的问题拿出来说一说吧。以前写主题很少对下拉菜单下过功夫，就算到后来也只是用 <abbr title="Cascading Style sheet">CSS</abbr> 写，没有动画效果，而且在 IE6 下是不会有显示的，在写 DarkLight 3.0 的时候，想用 jQuery 实现下拉菜单，然后遇到点问题。<span id="more-226"></span></p>
<p>我开始是这样写代码的（下拉+淡入淡出效果）：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav &gt; li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>然后问题出现了，看 <a href="http://www.alanoy.com/example/dropdownlist/jquery-dropdown-list-animate.html" title="jQuery Dropdown List" rel="nofollow">Demo</a>，但鼠标滑过菜单，然后向下滑的时候，下拉菜单在不断的重复向上向下的淡入淡出动作。用 <code class="codecolorer text dawn codes"><span class="text">.stop()</span></code> 方法行不通，google 之，在 <a href="http://zww.me/archives/25105" rel="nofollow" title="jQuery渐变下拉菜单的实现方法 - 完美篇">zwwooooo</a> 那发现了个方法，加个判断语句 <code class="codecolorer text dawn codes"><span class="text">if (!$(this).children(&quot;.children&quot;).is(&quot;:animated&quot;))</span></code>，就是说，在鼠标滑过没有在执行动画动作的菜单时才会执行动作，那么用 <code class="codecolorer text dawn codes"><span class="text">.filter(&quot;:not(:animated)&quot;)</span></code> 筛选出没有在执行动画的菜单来实现也一样：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav &gt; li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:not(:animated)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.children&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>再看看 <a href="http://www.alanoy.com/example/dropdownlist/jquery-dropdown-list-animate-fixed.html" title="jQuery Dropdown List" rel="nofollow">Demo</a>，问题解决了。</p>
<p>多级下拉菜单方法请查看 <a href='http://www.alanoy.com/jquery-multi-dropdown-list/' title='jQuery 实现多级下拉菜单'>jQuery 实现多级下拉菜单</a></p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/jquery-tab/" title="jQuery 实现网页选项卡">jQuery 实现网页选项卡</a> (26)<br /><small>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集...</small></li><li><a href="http://www.alanoy.com/jquery-multi-dropdown-list/" title="jQuery 实现多级下拉菜单">jQuery 实现多级下拉菜单</a> (8)<br /><small>在上篇文章 jQuery 实现下拉菜单方法 中写的代码仅仅是一级下拉菜单的情况，QiQiBoy 提了...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/jquery-dropdown-list/">Permalink</a> |
<a href="http://www.alanoy.com/jquery-dropdown-list/#comments">20 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/jquery-dropdown-list/&title=jQuery 实现下拉菜单方法">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/jquery-dropdown-list/&title=jQuery 实现下拉菜单方法" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/jquery-dropdown-list/&title=jQuery 实现下拉菜单方法" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/jquery-dropdown-list/&title=jQuery 实现下拉菜单方法" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/jquery-dropdown-list/&title=jQuery 实现下拉菜单方法" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/jquery/" rel="tag">jQuery</a>, <a href="http://www.alanoy.com/tag/note/" rel="tag">Note</a>, <a href="http://www.alanoy.com/tag/%e4%b8%8b%e6%8b%89%e8%8f%9c%e5%8d%95/" rel="tag">下拉菜单</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/jquery-dropdown-list/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>jQuery 隐藏老用户评论资料框</title>
		<link>http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/</link>
		<comments>http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 14:35:06 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuory]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=210</guid>
		<description><![CDATA[之前一直用的是 xiaorsz 的方法来隐藏老用户评论资料框，包括我发布的 DarkLight 和 G-White 主题也是用这方法。该方法在 jQuery 1.2 和 1.3 下能正常工作，但在 1.4 下却有问题，我也说不清，如果你在用的是 jQuery 1.4+ 的话，把 if($('input#author[value]').length&#62;0) 换成 if ($(&#34;#author&#34;).val()) （判断用户名输入框的值是否有值）即可。现在我把他的代码改进一下，并增加淡入淡出效果： 12345678910111213141516171819202122$&#40;document&#41;.ready&#40;function&#40;&#41; &#123; &#160; &#160; //判断用户名输入框是否有值 &#160; &#160; if &#40;$&#40;&#34;#author&#34;&#41;.val&#40;&#41;&#41; &#123; &#160; &#160; &#160; &#160; //隐藏资料框 &#160; &#160; &#160; &#160; $&#40;&#34;#author_info&#34;&#41;.hide&#40;&#41;; &#160; &#160; &#160; &#160; //建立一个编辑锚点，并赋值给edit &#160; &#160; &#160; &#160; var edit = &#34;&#60;span [...]]]></description>
			<content:encoded><![CDATA[<p>之前一直用的是 <a href="http://www.xiaorsz.com/hide-input-box-jquery/" rel="nofollow">xiaorsz</a> 的方法来隐藏老用户评论资料框，包括我发布的 <a href="http://www.alanoy.com/tag/darklight/" title="DarkLight Theme" rel="nofollow">DarkLight</a> 和 <a href="http://www.alanoy.com/tag/g-white/" title="G-White Theme" rel="nofollow">G-White</a> 主题也是用这方法。该方法在 jQuery 1.2 和 1.3 下能正常工作，但在 1.4 下却有问题，我也说不清，如果你在用的是 jQuery 1.4+ 的话，把 <code class="codecolorer text dawn codes"><span class="text">if($('input#author[value]').length&gt;0)</span></code> 换成 <code class="codecolorer text dawn codes"><span class="text">if ($(&quot;#author&quot;).val())</span></code> （判断用户名输入框的值是否有值）即可。现在我把他的代码改进一下，并增加淡入淡出效果：<span id="more-210"></span></p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//判断用户名输入框是否有值</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//隐藏资料框</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author_info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//建立一个编辑锚点，并赋值给edit</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> edit <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&lt;span id='eidt_info' style='cursor: pointer;color: #BF514C;'&gt;Edit your profile.&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//在welcome back后面插入“编辑锚点”edit</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.form_row&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>edit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#eidt_info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//第一次点击 edit 显示用户资料框，第二次点击则隐藏，依次循环</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author_info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;toggle&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;toggle&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//点击edit，用户资料框显示后，Edit your profile.变为Close.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;Edit your profile.&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#eidt_info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Close.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//点击edit, 用户资料框隐藏后，Close.变为 Edit your profile.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#eidt_info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Edit your profile.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>现在撇开以上方法。如果你的主题的 comments.php 里面用户资料框类似这样：</p>
<div class="codecolorer-container html4strict dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;author&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;author&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $comment_author; ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;1&quot; /&gt;<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;author&quot;</span>&gt;</span>Name:<span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot; (required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $comment_author_email; ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;2&quot; /&gt;<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span>&gt;</span>Email:<span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot; (required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $comment_author_url; ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span>&gt;</span>Website:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span></div></td></tr></tbody></table></div>
<p>如果这个资料框没有被某个 <code class="codecolorer text dawn codes"><span class="text">&lt;div&gt;</span></code> 标签包着的话，那么我们手动加一个 <code class="codecolorer text dawn codes"><span class="text">&lt;div id=&quot;author_info&quot;&gt; 用户资料框部分 &lt;/div&gt;</span></code>，如果已有 <code class="codecolorer text dawn codes"><span class="text">&lt;div&gt;</span></code> 标签包着，给他加个 <code class="codecolorer text dawn codes"><span class="text">id=&quot;author_info&quot;</span></code>。这里不手动增加 Welcome Back 部分，在浏览器不支持 javascript 的情况下，似乎意义不大，直接用 jQuery 增加这一部分就可以了（个人观点）：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//判断用户名输入框的值是否有值</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//把用户资料框赋值给info</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> info <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author_info&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//把用户名赋值给author</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> author <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//隐藏用户资料框</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; info.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//用户名样式为粗体，可要可不要</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#author&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fontWeight&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;bold&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//在用户资料框&lt;div id=&quot;author_info&quot;&gt;下的最开始插入&quot;Welcome back. Edit your info.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; info.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id='welcome_back'&gt;Welcome Back &quot;</span><span style="color: #339933;">+</span>author<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;. &lt;span id='edit_info' style='cursor: pointer; color: #BF514C;'&gt;Edit your info.&lt;/span&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//把&quot;edit your info.&quot;这个“编辑锚点”赋值给editInfo</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> editInfo <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#edit_info&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//点击“编辑锚点”editInfo</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; editInfo.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//资料框弹出效果和关闭效果</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;toggle&quot;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;toggle&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//资料框弹出时锚点显示为Close.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>editInfo.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;Edit your info.&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Close.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//隐藏后锚点显示为Edit your info.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Edit your info.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>其实就是比第一个方法在 comments.php 里面少见一个 Welcome back 的 php 语句。新手，欢迎探讨指教。<br />
PS. 实现以上方法的前提是你在 header 或者 footer 加载了 jQuery 库。这里推荐用 jQuery 1.3.2，直接加载 google 的：</p>
<div class="codecolorer-container html4strict dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></div></td></tr></tbody></table></div>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/wordpress-gravatar-cache/" title="Wordpress Gravatar 头像缓存">Wordpress Gravatar 头像缓存</a> (17)<br /><small>最近 Gravatar 头像老是显示不能，google 之得一好方法。来自 Willin 方法，将 ...</small></li><li><a href="http://www.alanoy.com/show-excerpt-and-read-more-for-g-white-theme/" title="G-White主题显示文章摘要">G-White主题显示文章摘要</a> (20)<br /><small>Wordpress 显示文章摘要，其实在文章编辑器有个 more 标签，很多人都知道啦，昨天有位同学...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li><li><a href="http://www.alanoy.com/jquery-tab/" title="jQuery 实现网页选项卡">jQuery 实现网页选项卡</a> (26)<br /><small>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集...</small></li><li><a href="http://www.alanoy.com/wordpress-theme-darklight-3/" title="Wordpress主题：DarkLight 3.0">Wordpress主题：DarkLight 3.0</a> (56)<br /><small>当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Te...</small></li><li><a href="http://www.alanoy.com/jquery-multi-dropdown-list/" title="jQuery 实现多级下拉菜单">jQuery 实现多级下拉菜单</a> (8)<br /><small>在上篇文章 jQuery 实现下拉菜单方法 中写的代码仅仅是一级下拉菜单的情况，QiQiBoy 提了...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/">Permalink</a> |
<a href="http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/#comments">10 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/&title=jQuery 隐藏老用户评论资料框">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/&title=jQuery 隐藏老用户评论资料框" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/&title=jQuery 隐藏老用户评论资料框" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/&title=jQuery 隐藏老用户评论资料框" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/&title=jQuery 隐藏老用户评论资料框" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/jquory/" rel="tag">jQuory</a>, <a href="http://www.alanoy.com/tag/tutorial/" rel="tag">Tutorial</a>, <a href="http://www.alanoy.com/tag/wordpress/" rel="tag">Wordpress</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>DarkLight和G-White主题的图片透明效果和超链接背景</title>
		<link>http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/</link>
		<comments>http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 09:26:55 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[DarkLight]]></category>
		<category><![CDATA[G-White]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=199</guid>
		<description><![CDATA[DarkLight 和 G-White 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如何去掉该效果，个人喜好不能加于公布的主题中，以后要注意，去掉的方法就是，在 style.css 中找到 .entrybody img，删除里面的 123filter: alpha&#40;opacity=80&#41;; opacity: 0.8; -moz-opacity: 0.8; 这三行，顺便把 .entrybody img:hover 整个删掉。 还有个问题是，这俩主题中，超链接图片在鼠标滑过时，图片底部会留下的红色背景，是我给超链接在鼠标滑过 a:hover 时设置了 padding 和 background 属性导致的，要去掉的话修改超链接的样式，去掉其内边距和背景属性。如果想保留超链接原来的样式，我写了个 jQuery，去掉超链接图片的背景和样式： 123$&#40;document&#41;.ready&#40;function&#40;&#41; &#123; &#160; &#160; $&#40;&#34;.entrybody a img&#34;&#41;.parent&#40;&#34;a&#34;&#41;.css&#40;&#123;&#34;background&#34;: &#34;none&#34;, &#34;padding&#34;: &#34;0&#34;&#125;&#41;; &#125;&#41;; 代码放到 js 文件夹下的 all.js 里面。这两个主题已经调用了 jQuery 库，如果你已经删掉了，那不会有效果。 Related Posts关于DarkLight主题新版本的开发 (18)在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结...WordPress主题G-White更新到Ver 2.4 (89)G-White [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alanoy.com/tag/darklight/" title="DarkLight Theme">DarkLight</a> 和 <a href="http://www.alanoy.com/tag/g-white/" title="G-White Theme">G-White</a> 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如何去掉该效果，个人喜好不能加于公布的主题中，以后要注意，去掉的方法就是，在 style.css 中找到 <em>.entrybody img</em>，删除里面的<span id="more-199"></span></p>
<div class="codecolorer-container css dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">80</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">;</span><br />
-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>这三行，顺便把 <em>.entrybody img:hover</em> 整个删掉。</p>
<p>还有个问题是，这俩主题中，超链接图片在鼠标滑过时，图片底部会留下的红色背景，是我给超链接在鼠标滑过 <em>a:hover</em> 时设置了 <em>padding</em> 和 <em>background</em> 属性导致的，要去掉的话修改超链接的样式，去掉其内边距和背景属性。如果想保留超链接原来的样式，我写了个 jQuery，去掉超链接图片的背景和样式：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.entrybody a img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;background&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;none&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;padding&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>代码放到 js 文件夹下的 all.js 里面。这两个主题已经调用了 jQuery 库，如果你已经删掉了，那不会有效果。</p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/about-new-darklight-theme/" title="关于DarkLight主题新版本的开发">关于DarkLight主题新版本的开发</a> (18)<br /><small>在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li><li><a href="http://www.alanoy.com/wordpress-theme-darklight-3/" title="Wordpress主题：DarkLight 3.0">Wordpress主题：DarkLight 3.0</a> (56)<br /><small>当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Te...</small></li><li><a href="http://www.alanoy.com/use-photo-to-replace-the-text-logo/" title="用图片替换文字Logo">用图片替换文字Logo</a> (15)<br /><small>用自制的图片来做博客的 Logo 相对文字 Logo 来说更美观、更多自定义性，鉴于 DarkLig...</small></li><li><a href="http://www.alanoy.com/show-excerpt-and-read-more-for-g-white-theme/" title="G-White主题显示文章摘要">G-White主题显示文章摘要</a> (20)<br /><small>Wordpress 显示文章摘要，其实在文章编辑器有个 more 标签，很多人都知道啦，昨天有位同学...</small></li><li><a href="http://www.alanoy.com/styles-of-related-posts-and-bread-crumb/" title="关于DarkLight的相关文章和Bread Crumb样式">关于DarkLight的相关文章和Bread Crumb样式</a> (68)<br /><small>首先提个与本文章内容无关的，发现太多朋友喜欢去掉版权信息了，想不明白，版权信息就那么碍眼？？！像 J...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/">Permalink</a> |
<a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/#comments">10 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/&title=DarkLight和G-White主题的图片透明效果和超链接背景">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/&title=DarkLight和G-White主题的图片透明效果和超链接背景" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/&title=DarkLight和G-White主题的图片透明效果和超链接背景" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/&title=DarkLight和G-White主题的图片透明效果和超链接背景" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/&title=DarkLight和G-White主题的图片透明效果和超链接背景" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/darklight/" rel="tag">DarkLight</a>, <a href="http://www.alanoy.com/tag/g-white/" rel="tag">G-White</a>, <a href="http://www.alanoy.com/tag/tutorial/" rel="tag">Tutorial</a>, <a href="http://www.alanoy.com/tag/wordpress-theme/" rel="tag">Wordpress Theme</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>关于DarkLight主题新版本的开发</title>
		<link>http://www.alanoy.com/about-new-darklight-theme/</link>
		<comments>http://www.alanoy.com/about-new-darklight-theme/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 02:18:23 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[DarkLight]]></category>
		<category><![CDATA[G-White]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/%e5%85%b3%e4%ba%8edarklight%e4%b8%bb%e9%a2%98%e6%96%b0%e7%89%88%e6%9c%ac%e7%9a%84%e5%bc%80%e5%8f%91/</guid>
		<description><![CDATA[在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结构和 CSS 代码还有一些不合理和冗余的地方，结构方面已改好，正在重新写 CSS 代码。但受到 Jinwen 这篇文章的影响，我也有意尝试用 WordPress 官方主题进行开发，毕竟我的那些代码是从 WordPress 2.5 用到现在的，需要全面更新一下了，所以有了把 DarkLight 和 G-White 3.0 化的想法，即在 Twenty Ten 主题结构基础上的更新开发。 回到正题，首先是对 DarkLight 的更新，版本直接跳到 3.0 且不在对之前版本进行维护改进。说说几点特性，喜欢 DarkLight 主题的可以提提意见： Ajax Comment，这次会使用 Willin 最新的改进版。 嵌套评论，样式会有所改变，敬请关注 内嵌文章分页，这次不用 wp-pagenavi，而使用还是来自 Willin 的 Mini Pagenavi，很小巧。 一些 JavaScript 效果：如点击 Reply 自动添加 @somebody，下拉菜单，Ctrl+Enter 回复评论，在考虑要不要加页面滚动效果，个人觉得没什么必要。 进度不会很快，现在失业中，正在学习，杯具。 Related PostsWordpress主题：DarkLight 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p>在 <a href="http://www.alanoy.com/tag/g-white" rel="nofollow" title="G-White Theme">G-White</a> 更新到 v2.4 后，其实前阵子还是在对 <a href="http://www.alanoy.com/tag/g-white" rel="nofollow" title="G-White Theme">G-White</a> 进行修改，因为主题的结构和 <abbr title="Cascading Style Sheet">CSS</abbr> 代码还有一些不合理和冗余的地方，结构方面已改好，正在重新写 <abbr title="Cascading Style Sheet">CSS</abbr> 代码。但受到 <a href="http://www.saywp.com/wordpress/my-new-theme-and-twentyten.html" rel="nofollow external" title="Jinwen">Jinwen</a> 这篇文章的影响，我也有意尝试用 WordPress 官方主题进行开发，毕竟我的那些代码是从 WordPress 2.5 用到现在的，需要全面更新一下了，所以有了把 <a href="http://www.alanoy.com/tag/darklight" rel="nofollow" title="DarkLight Theme">DarkLight</a> 和 <a href="http://www.alanoy.com/tag/g-white" rel="nofollow" title="G-White Theme">G-White</a> 3.0 化的想法，即在 Twenty Ten 主题结构基础上的更新开发。<span id="more-183"></span></p>
<p>回到正题，首先是对 <a href="http://www.alanoy.com/tag/darklight" rel="nofollow" title="DarkLight Theme">DarkLight</a> 的更新，版本直接跳到 3.0 且不在对之前版本进行维护改进。说说几点特性，喜欢 DarkLight 主题的可以提提意见：</p>
<ol>
<li>Ajax Comment，这次会使用 <a href="http://kan.willin.org/?p=1271" rel="external nofollow" title="Ajax Comment">Willin</a> 最新的改进版。</li>
<li>嵌套评论，样式会有所改变，敬请关注</li>
<li>内嵌文章分页，这次不用 wp-pagenavi，而使用还是来自 Willin 的 <a href="http://kan.willin.org/?p=1323" rel="external nofollow" title="Mini Pagenavi">Mini Pagenavi</a>，很小巧。</li>
<li>一些 JavaScript 效果：如点击 Reply 自动添加 @somebody，下拉菜单，Ctrl+Enter 回复评论，在考虑要不要加页面滚动效果，个人觉得没什么必要。</li>
</ol>
<p>进度不会很快，现在失业中，正在学习，杯具。</p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/wordpress-theme-darklight-3/" title="Wordpress主题：DarkLight 3.0">Wordpress主题：DarkLight 3.0</a> (56)<br /><small>当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Te...</small></li><li><a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/" title="DarkLight和G-White主题的图片透明效果和超链接背景">DarkLight和G-White主题的图片透明效果和超链接背景</a> (10)<br /><small>DarkLight 和 G-White 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li><li><a href="http://www.alanoy.com/wordpress-theme-g-white-2-2/" title="Wordpress Theme: G-White 2.0">Wordpress Theme: G-White 2.0</a> (116)<br /><small>G-White 是自己做的一个比较久远的主题了，跟 DarkLight 一样，这次也直接跳到 Ver...</small></li><li><a href="http://www.alanoy.com/darklight-2-3/" title="DarkLight 2.3">DarkLight 2.3</a> (107)<br /><small>这两天开始动手修改 G-White 主题，很多东西修改，还是比较麻烦的，费了不少时间，然后在各浏览器...</small></li><li><a href="http://www.alanoy.com/darklight-2/" title="DarkLight 2.0">DarkLight 2.0</a> (128)<br /><small>DarkLight 2.0 终于如期发布，上个版本 1.04 直接跳到 2.0，改了挺多东西的，优化...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/about-new-darklight-theme/">Permalink</a> |
<a href="http://www.alanoy.com/about-new-darklight-theme/#comments">18 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/about-new-darklight-theme/&title=关于DarkLight主题新版本的开发">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/about-new-darklight-theme/&title=关于DarkLight主题新版本的开发" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/about-new-darklight-theme/&title=关于DarkLight主题新版本的开发" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/about-new-darklight-theme/&title=关于DarkLight主题新版本的开发" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/about-new-darklight-theme/&title=关于DarkLight主题新版本的开发" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/darklight/" rel="tag">DarkLight</a>, <a href="http://www.alanoy.com/tag/g-white/" rel="tag">G-White</a>, <a href="http://www.alanoy.com/tag/wordpress/" rel="tag">Wordpress</a>, <a href="http://www.alanoy.com/tag/wordpress-theme/" rel="tag">Wordpress Theme</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/about-new-darklight-theme/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>IE6什么时候才能挂掉？Let&#8217;s Kill IE6！</title>
		<link>http://www.alanoy.com/lets-kill-ie6/</link>
		<comments>http://www.alanoy.com/lets-kill-ie6/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 04:33:50 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=156</guid>
		<description><![CDATA[说起 IE6，很多 Web 前端工作者对其无不厌恶，不说做前端开发的童鞋，就说我弄个主题，经常被 IE6 的 Bug 搞得很头疼，所以在现在使用的这个新主题 Untitled 中对 IE6 的 Hack 已经很少了，简直是浪费时间和生命，但为了用户往往又不得不选择去 Hack，囧。 去 google Analytics 看了近两个月的浏览器使用者： 最多的是 IE，其次是 Firefox 和 Chrome，其中 IE6 的用户占 IE 所有版本浏览器中的 43%，天啊，我想不明白为什么还有这么多人用 IE6，IE7、IE8 都出了很久了吧，泪奔。。。 无奈，之前用的是 mg12 的 Let&#8217;s kill IE6 脚本，但弹出窗口着实体验太差，就像窗口弹出附着广告那样让人讨厌，所以直接用 IE6 注释在侧边栏加上 IE6 用户才能看到的信息： IE6 存在太多的 Bug，已经是一个很过时的浏览器，为什么不升级您的 IE 版本到 IE8 呢？或者尝试其它几款比 IE 更出色的浏览器呢？Let&#8217;s Kill IE6！！！ Random PostsjQuery [...]]]></description>
			<content:encoded><![CDATA[<p>说起 IE6，很多 Web 前端工作者对其无不厌恶，不说做前端开发的童鞋，就说我弄个主题，经常被 IE6 的 Bug 搞得很头疼，所以在现在使用的这个新主题 Untitled 中对 IE6 的 Hack 已经很少了，简直是浪费时间和生命，但为了用户往往又不得不选择去 Hack，囧。<span id="more-156"></span></p>
<p>去 google Analytics 看了近两个月的浏览器使用者：<br />
<a href="http://www.alanoy.com/wp-content/uploads/2010/08/all-browsers-datas.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/all-browsers-datas.png" alt="Browser Data" title="所有浏览器访问数据" width="389" height="208" class="alignnone size-full wp-image-157" /></a></p>
<p>最多的是 IE，其次是 Firefox 和 Chrome，其中 IE6 的用户占 IE 所有版本浏览器中的 43%，天啊，我想不明白为什么还有这么多人用 IE6，IE7、IE8 都出了很久了吧，泪奔。。。<br />
<a href="http://www.alanoy.com/wp-content/uploads/2010/08/percentage-of-ie6.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/percentage-of-ie6.png" alt="IE6 Percentage" title="IE6使用数量占IE浏览器的百分比" width="388" height="123" class="alignnone size-full wp-image-160" /></a></p>
<p>无奈，之前用的是 <a href="http://www.neoease.com" rel="nofollow">mg12</a> 的 Let&#8217;s kill IE6 脚本，但弹出窗口着实体验太差，就像窗口弹出附着广告那样让人讨厌，所以直接用 IE6 注释在侧边栏加上 IE6 用户才能看到的信息：<br />
<a href="http://www.alanoy.com/wp-content/uploads/2010/08/kill-ie6-sidebar-item.png"><img src="http://www.alanoy.com/wp-content/uploads/2010/08/kill-ie6-sidebar-item.png" alt="Kill IE6" title="Lets Kill IE6" width="282" height="169" class="alignnone size-full wp-image-163" /></a></p>
<p>IE6 存在太多的 Bug，已经是一个很过时的浏览器，为什么不升级您的 IE 版本到 IE8 呢？或者尝试其它几款比 IE 更出色的浏览器呢？Let&#8217;s Kill IE6！！！</p>
<h4  class="related_post_title">Random Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/darklight-2/" title="DarkLight 2.0">DarkLight 2.0</a> (128)<br /><small>DarkLight 2.0 终于如期发布，上个版本 1.04 直接跳到 2.0，改了挺多东西的，优化...</small></li><li><a href="http://www.alanoy.com/about-new-darklight-theme/" title="关于DarkLight主题新版本的开发">关于DarkLight主题新版本的开发</a> (18)<br /><small>在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结...</small></li><li><a href="http://www.alanoy.com/use-photo-to-replace-the-text-logo/" title="用图片替换文字Logo">用图片替换文字Logo</a> (15)<br /><small>用自制的图片来做博客的 Logo 相对文字 Logo 来说更美观、更多自定义性，鉴于 DarkLig...</small></li><li><a href="http://www.alanoy.com/douban-radio-desktop-ver/" title="两个豆瓣电台桌面版">两个豆瓣电台桌面版</a> (8)<br /><small>最近电脑上的歌快听腻了，也懒得去下载，然后喜欢上了听豆瓣电台，相对于网页版我更喜欢用桌面版，因为可以...</small></li><li><a href="http://www.alanoy.com/styles-of-related-posts-and-bread-crumb/" title="关于DarkLight的相关文章和Bread Crumb样式">关于DarkLight的相关文章和Bread Crumb样式</a> (68)<br /><small>首先提个与本文章内容无关的，发现太多朋友喜欢去掉版权信息了，想不明白，版权信息就那么碍眼？？！像 J...</small></li><li><a href="http://www.alanoy.com/these-busy-days/" title="最近这些日子">最近这些日子</a> (17)<br /><small>最近特别忙，每天加班 2-4 个小时，公司准备累死人不偿命 Orz，没事干就裁员，裁完就搞一大堆事来...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/lets-kill-ie6/">Permalink</a> |
<a href="http://www.alanoy.com/lets-kill-ie6/#comments">37 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/lets-kill-ie6/&title=IE6什么时候才能挂掉？Let&#8217;s Kill IE6！">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/lets-kill-ie6/&title=IE6什么时候才能挂掉？Let&#8217;s Kill IE6！" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/lets-kill-ie6/&title=IE6什么时候才能挂掉？Let&#8217;s Kill IE6！" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/lets-kill-ie6/&title=IE6什么时候才能挂掉？Let&#8217;s Kill IE6！" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/lets-kill-ie6/&title=IE6什么时候才能挂掉？Let&#8217;s Kill IE6！" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/chrome/" rel="tag">Chrome</a>, <a href="http://www.alanoy.com/tag/firefox/" rel="tag">Firefox</a>, <a href="http://www.alanoy.com/tag/ie6/" rel="tag">IE6</a>, <a href="http://www.alanoy.com/tag/ie8/" rel="tag">IE8</a>, <a href="http://www.alanoy.com/tag/opera/" rel="tag">Opera</a>, <a href="http://www.alanoy.com/tag/safari/" rel="tag">Safari</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/lets-kill-ie6/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>两个豆瓣电台桌面版</title>
		<link>http://www.alanoy.com/douban-radio-desktop-ver/</link>
		<comments>http://www.alanoy.com/douban-radio-desktop-ver/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 03:01:08 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[dbRadio]]></category>
		<category><![CDATA[DoubanRadio]]></category>
		<category><![CDATA[豆瓣]]></category>
		<category><![CDATA[豆瓣电台]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=135</guid>
		<description><![CDATA[最近电脑上的歌快听腻了，也懒得去下载，然后喜欢上了听豆瓣电台，相对于网页版我更喜欢用桌面版，因为可以直接按快捷键听下一首，标记 fav，方便很多。 这第一个 DoubanRadio (开发者 slippor)应该挺多人用的，除了豆瓣电台的基本功能外，支持插件，支持快捷键，内置搜索引擎，托盘气泡提示播放歌曲（可以设置去掉，我觉得挺烦的），可以设置在 MSN 中显示“正在听的音乐”等等，还有其他挺多功能设置的，可以先看看此图文版介绍（旧版本的图片）。 第二个是由 CodeName.A 的 dbRadio，正式版刚出，需要安装 .NET Framework 4.0 才能使用，哥电脑上已经有 1.1、2.0、3.0、3.5 四个版本了，写这文章时正在装 4.0，微软就不能智能点，装新版本的时候自动删除旧版？回到正题吧，dbRadio 界面更好看，看图文介绍吧： 下载地址：豆瓣 补充一下：试用了 dbRadio，界面不错，动态效果也不错，功能设置方面相对第一个的 DoubanRadio 少了很多，如果快捷键能自己设置就好了，还有切歌好慢咯 再补充：给 CodeName.A 反馈后，很快他做出了完善，beta 版已经解决了播放出现断断续续或者卡住等问题，的确很喜欢这款 dbRadio，值得期待。 Random PostsWordpress Theme: G-White 2.0 (116)G-White 是自己做的一个比较久远的主题了，跟 DarkLight 一样，这次也直接跳到 Ver...jQuery 实现多级下拉菜单 (8)在上篇文章 jQuery 实现下拉菜单方法 中写的代码仅仅是一级下拉菜单的情况，QiQiBoy 提了...IE6什么时候才能挂掉？Let&#8217;s Kill IE6！ (37)说起 IE6，很多 Web 前端工作者对其无不厌恶，不说做前端开发的童鞋，就说我弄个主题，经常被 I...WordPress主题G-White更新到Ver 2.4 (89)G-White [...]]]></description>
			<content:encoded><![CDATA[<p>最近电脑上的歌快听腻了，也懒得去下载，然后喜欢上了听豆瓣电台，相对于网页版我更喜欢用桌面版，因为可以直接按快捷键听下一首，标记 fav，方便很多。</p>
<p>这第一个 DoubanRadio (开发者 <a href="http://slippor.blogbus.com/" rel="nofollow">slippor</a>)应该挺多人用的，除了豆瓣电台的基本功能外，支持插件，支持快捷键，内置搜索引擎，托盘气泡提示播放歌曲（可以设置去掉，我觉得挺烦的），可以设置在 MSN 中显示“正在听的音乐”等等，还有其他挺多功能设置的，可以先看看<a href="http://slippor.blogbus.com/logs/62644175.html" rel="nofollow">此图文版介绍</a>（旧版本的图片）。<span id="more-135"></span></p>
<p>第二个是由 <a href="http://www.douban.com/people/CodeName.A/" rel="nofollow">CodeName.A</a> 的 dbRadio，正式版刚出，需要安装 .NET Framework 4.0 才能使用，哥电脑上已经有 1.1、2.0、3.0、3.5 四个版本了，写这文章时正在装 4.0，微软就不能智能点，装新版本的时候自动删除旧版？回到正题吧，dbRadio 界面更好看，看图文介绍吧：</p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-01.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-01-e1280371762383.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio登陆界面" width="520" height="384" class="alignnone size-full wp-image-136" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-02.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-02-e1280371806385.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio迷你界面" width="520" height="302" class="alignnone size-full wp-image-137" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-03-e1280371868255.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-03-e1280371868255.jpg" alt="" title="dbRadio播放界面" width="520" height="385" class="alignnone size-full wp-image-138" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-04.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-04-e1280371962294.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio电台频道设置" width="520" height="385" class="alignnone size-full wp-image-139" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-05.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-05-e1280371989260.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio屏蔽歌手界面" width="520" height="385" class="alignnone size-full wp-image-140" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-06.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-06-e1280372023810.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio功能设置界面" width="520" height="345" class="alignnone size-full wp-image-141" /></a></p>
<p><a href="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-07.jpg"><img src="http://www.alanoy.com/wp-content/uploads/2010/07/dbRadio-07-e1280372049634.jpg" alt="豆瓣电台桌面版 dbRadio" title="dbRadio使用指南" width="520" height="372" class="alignnone size-full wp-image-142" /></a></p>
<p>下载地址：<a href="http://www.douban.com/note/81112900/" rel="nofollow">豆瓣</a></p>
<p>补充一下：试用了 dbRadio，界面不错，动态效果也不错，功能设置方面相对第一个的 DoubanRadio 少了很多，如果快捷键能自己设置就好了，<del datetime="2010-08-02T16:30:54+00:00">还有切歌好慢咯</del><br />
再补充：给 <a href="http://www.douban.com/people/CodeName.A/" rel="nofollow">CodeName.A</a> 反馈后，很快他做出了完善，<a href="http://www.douban.com/note/81112900/" rel="nofollow">beta 版</a>已经解决了播放出现断断续续或者卡住等问题，的确很喜欢这款 dbRadio，值得期待。</p>
<h4  class="related_post_title">Random Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/about-new-darklight-theme/" title="关于DarkLight主题新版本的开发">关于DarkLight主题新版本的开发</a> (18)<br /><small>在 G-White 更新到 v2.4 后，其实前阵子还是在对 G-White 进行修改，因为主题的结...</small></li><li><a href="http://www.alanoy.com/darklight-2/" title="DarkLight 2.0">DarkLight 2.0</a> (128)<br /><small>DarkLight 2.0 终于如期发布，上个版本 1.04 直接跳到 2.0，改了挺多东西的，优化...</small></li><li><a href="http://www.alanoy.com/jquery-tab/" title="jQuery 实现网页选项卡">jQuery 实现网页选项卡</a> (26)<br /><small>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li><li><a href="http://www.alanoy.com/darklight-2-3/" title="DarkLight 2.3">DarkLight 2.3</a> (107)<br /><small>这两天开始动手修改 G-White 主题，很多东西修改，还是比较麻烦的，费了不少时间，然后在各浏览器...</small></li><li><a href="http://www.alanoy.com/fix-radmo-post-problem-fater-update-to-wordpress-3/" title="升级WordPress 3.0后随机文章显示不了">升级WordPress 3.0后随机文章显示不了</a> (11)<br /><small>消失了很久了，最近升级到 Wordpress 3.0 后，发现 DarkLight 和 G-Whit...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/douban-radio-desktop-ver/">Permalink</a> |
<a href="http://www.alanoy.com/douban-radio-desktop-ver/#comments">8 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/douban-radio-desktop-ver/&title=两个豆瓣电台桌面版">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/douban-radio-desktop-ver/&title=两个豆瓣电台桌面版" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/douban-radio-desktop-ver/&title=两个豆瓣电台桌面版" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/douban-radio-desktop-ver/&title=两个豆瓣电台桌面版" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/douban-radio-desktop-ver/&title=两个豆瓣电台桌面版" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/dbradio/" rel="tag">dbRadio</a>, <a href="http://www.alanoy.com/tag/doubanradio/" rel="tag">DoubanRadio</a>, <a href="http://www.alanoy.com/tag/douban/" rel="tag">豆瓣</a>, <a href="http://www.alanoy.com/tag/douban-radio/" rel="tag">豆瓣电台</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/douban-radio-desktop-ver/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WordPress Gravatar 头像缓存</title>
		<link>http://www.alanoy.com/wordpress-gravatar-cache/</link>
		<comments>http://www.alanoy.com/wordpress-gravatar-cache/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:09:16 +0000</pubDate>
		<dc:creator>Alan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.alanoy.com/?p=131</guid>
		<description><![CDATA[最近 Gravatar 头像老是显示不能，google 之得一好方法。来自 Willin 方法，将 Gravatar 头像缓存到服务器，不错、够速度，故分享之。 首先在你的网站 wp-content 的同级目录建立：/avatar，权限设置:755，这是 Gravatar 的缓存路径。 准备一张适合你模板尺寸的默认头像，名为 default.jpg。 将下列代码复制到模板的 functions.php 下： 12345678910111213141516171819/* Mini Gavatar Cache by Willin Kan. */ function my_avatar&#40; $email, $size = '42', $default = '', $alt = false &#41; &#123; &#160; $alt = &#40;false === $alt&#41; ? '' : esc_attr&#40; $alt &#41;; &#160; $f = [...]]]></description>
			<content:encoded><![CDATA[<p>最近 Gravatar 头像老是显示不能，google 之得一好方法。来自 <a href="http://kan.willin.org/?p=1320" rel="nofollow">Willin</a> 方法，将 Gravatar 头像缓存到服务器，不错、够速度，故分享之。<span id="more-131"></span></p>
<blockquote><p>
首先在你的网站 wp-content 的同级目录建立：/avatar，权限设置:755，这是 Gravatar 的缓存路径。<br />
准备一张适合你模板尺寸的默认头像，名为 default.jpg。<br />
将下列代码复制到模板的 functions.php 下：</p>
<div class="codecolorer-container javascript dawn codes" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:98%;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/* Mini Gavatar Cache by Willin Kan. */</span><br />
<span style="color: #003366; font-weight: bold;">function</span> my_avatar<span style="color: #009900;">&#40;</span> $email<span style="color: #339933;">,</span> $size <span style="color: #339933;">=</span> <span style="color: #3366CC;">'42'</span><span style="color: #339933;">,</span> $default <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> $alt <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; $alt <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span> <span style="color: #339933;">===</span> $alt<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">:</span> esc_attr<span style="color: #009900;">&#40;</span> $alt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; $f <span style="color: #339933;">=</span> md5<span style="color: #009900;">&#40;</span> strtolower<span style="color: #009900;">&#40;</span> $email <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; $w <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'wpurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; $a <span style="color: #339933;">=</span> $w. <span style="color: #3366CC;">'/avatar/'</span>. $f. <span style="color: #3366CC;">'.jpg'</span><span style="color: #339933;">;</span><br />
&nbsp; $e <span style="color: #339933;">=</span> ABSPATH. <span style="color: #3366CC;">'avatar/'</span>. $f. <span style="color: #3366CC;">'.jpg'</span><span style="color: #339933;">;</span><br />
&nbsp; $t <span style="color: #339933;">=</span> <span style="color: #CC0000;">1209600</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//設定14天, 單位:秒</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> empty<span style="color: #009900;">&#40;</span>$default<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> $default <span style="color: #339933;">=</span> $w. <span style="color: #3366CC;">'/avatar/default.jpg'</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_file<span style="color: #009900;">&#40;</span>$e<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> filemtime<span style="color: #009900;">&#40;</span>$e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> $t <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//當頭像不存在或文件超過14天才更新</span><br />
&nbsp; &nbsp; $r <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'avatar_rating'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $g <span style="color: #339933;">=</span> sprintf<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;http://%d.gravatar.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span> hexdec<span style="color: #009900;">&#40;</span> $f<span style="color: #009900;">&#123;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>. <span style="color: #3366CC;">'/avatar/'</span>. $f. <span style="color: #3366CC;">'?s='</span>. $size. <span style="color: #3366CC;">'&amp;d='</span>. $default. <span style="color: #3366CC;">'&amp;r='</span>. $r<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; copy<span style="color: #009900;">&#40;</span>$g<span style="color: #339933;">,</span> $e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> $a <span style="color: #339933;">=</span> esc_attr<span style="color: #009900;">&#40;</span>$g<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//新頭像 copy 時, 取 gravatar 顯示</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>filesize<span style="color: #009900;">&#40;</span>$e<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span> copy<span style="color: #009900;">&#40;</span>$default<span style="color: #339933;">,</span> $e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; $avatar <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&lt;img title='{$alt}' alt='{$alt}' src='{$a}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' /&gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">return</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'my_avatar'</span><span style="color: #339933;">,</span> $avatar<span style="color: #339933;">,</span> $email<span style="color: #339933;">,</span> $size<span style="color: #339933;">,</span> $default<span style="color: #339933;">,</span> $alt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">// -- END ----------------------------------------</span></div></td></tr></tbody></table></div>
<p>上面第一行的 $size 可自定义头像大小<br />
然后将所有 get_avatar() 改 my_avatar()，大概 functions.php，comments.php，sidebar.php，comments-ajax.php 会有头像的地方有 get_avatar() 函数，因主题而已，自行修改。</p>
<p>注意 my_avatar() 的方法和 get_avatar() 有一点差别：<br />
get_avatar() 可用 id 或 email，可写成 get_avatar($comment, $size= &#8230;<br />
而 my_avatar() 只能用 email，要改成 my_avatar($comment->comment_author_email, $size= &#8230;<br />
使用参数如下：<code class="codecolorer php dawn codes"><span class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> my_avatar<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$default</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alt</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span></code></p></blockquote>
<p>以上转自 <a href="http://kan.willin.org/?p=1320" rel="nofollow" title="新版 Gravatar 缓存">Willin 的新版 Gravatar 缓存</a>，其实后面还有第二个方法，不用修改模板的，但有点小缺陷，详见该文的后续部分。</p>
<h4  class="related_post_title">Related Posts</h4><ul class="related_post"><li><a href="http://www.alanoy.com/use-jquery-to-hide-the-comment-author-info-for-commented-users/" title="jQuery 隐藏老用户评论资料框">jQuery 隐藏老用户评论资料框</a> (10)<br /><small>之前一直用的是 xiaorsz 的方法来隐藏老用户评论资料框，包括我发布的 DarkLight 和 ...</small></li><li><a href="http://www.alanoy.com/show-excerpt-and-read-more-for-g-white-theme/" title="G-White主题显示文章摘要">G-White主题显示文章摘要</a> (20)<br /><small>Wordpress 显示文章摘要，其实在文章编辑器有个 more 标签，很多人都知道啦，昨天有位同学...</small></li><li><a href="http://www.alanoy.com/updated-g-whtie-wordpress-theme-to-verson-2-4/" title="WordPress主题G-White更新到Ver 2.4">WordPress主题G-White更新到Ver 2.4</a> (89)<br /><small>G-White 和 DarkLight 都许久没更新，这次先对 G-White 动手。修改的时候发现...</small></li><li><a href="http://www.alanoy.com/jquery-tab/" title="jQuery 实现网页选项卡">jQuery 实现网页选项卡</a> (26)<br /><small>很多网站都有使用网页选项卡，最常见的就是博客的侧边栏上，比如把最新文章、随机文章、最受欢迎文章三项集...</small></li><li><a href="http://www.alanoy.com/wordpress-theme-darklight-3/" title="Wordpress主题：DarkLight 3.0">Wordpress主题：DarkLight 3.0</a> (56)<br /><small>当有了计划，马上就想去完成它，但我也没想到这么快，大概主题结构的折腾少了的缘故吧。Twenty Te...</small></li><li><a href="http://www.alanoy.com/opacity-and-links-background-of-images-of-darklight-and-g-white-theme/" title="DarkLight和G-White主题的图片透明效果和超链接背景">DarkLight和G-White主题的图片透明效果和超链接背景</a> (10)<br /><small>DarkLight 和 G-White 主题中我都加了图片透明效果，现在看来有点蛋疼，许多童鞋问我如...</small></li></ul><hr />
<p>© Alan for <a href="http://www.alanoy.com">Alan&#039;s World</a>, 2010. |
<a href="http://www.alanoy.com/wordpress-gravatar-cache/">Permalink</a> |
<a href="http://www.alanoy.com/wordpress-gravatar-cache/#comments">17 comments</a><br />
Add to <a href="http://del.icio.us/post?url=http://www.alanoy.com/wordpress-gravatar-cache/&title=WordPress Gravatar 头像缓存">del.icio.us</a> | <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.alanoy.com/wordpress-gravatar-cache/&title=WordPress Gravatar 头像缓存" alt="Google Bookmark" title="add to google bookmark">Google Bookmark</a> | <a href="http://digg.com/submit?phase=2&url=http://www.alanoy.com/wordpress-gravatar-cache/&title=WordPress Gravatar 头像缓存" alt="Digg" title="add to Digg">Digg</a> | <a href="https://favorites.live.com/quickadd.aspx?url=http://www.alanoy.com/wordpress-gravatar-cache/&title=WordPress Gravatar 头像缓存" alt="Live Bookmark" title="add to Live Bookmark">Live Bookmark</a> | <a href="http://www.facebook.com/share.php?u=http://www.alanoy.com/wordpress-gravatar-cache/&title=WordPress Gravatar 头像缓存" alt="Facebook" title="add to Facebook">Facebook</a>  
<br/>
Post tags: <a href="http://www.alanoy.com/tag/gravatar/" rel="tag">Gravatar</a>, <a href="http://www.alanoy.com/tag/tutorial/" rel="tag">Tutorial</a>, <a href="http://www.alanoy.com/tag/wordpress/" rel="tag">Wordpress</a><br/>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.alanoy.com/wordpress-gravatar-cache/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
