<?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>Simple happiness &#187; jquery</title>
	<atom:link href="http://xfuxing.com/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://xfuxing.com</link>
	<description>越简单越幸福</description>
	<lastBuildDate>Sun, 01 Jan 2012 16:55:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>不用插件打造自己的存档页</title>
		<link>http://xfuxing.com/2009/no-plug-ins-to-create-their-own-archive-page.html</link>
		<comments>http://xfuxing.com/2009/no-plug-ins-to-create-their-own-archive-page.html#comments</comments>
		<pubDate>Fri, 28 Aug 2009 14:23:04 +0000</pubDate>
		<dc:creator>德海</dc:creator>
				<category><![CDATA[关注网络]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp_easyarchives]]></category>
		<category><![CDATA[不用插件]]></category>
		<category><![CDATA[存档页]]></category>

		<guid isPermaLink="false">http://xfuxing.com/abc/69</guid>
		<description><![CDATA[首先声明，这篇文章的源代码来自“偶爱偶家”，本人从“不务正业”处取得源文件下载，呵，不过鉴于两处的下载似乎都链接不上，且原文上并没有直接给出源代码，那么我在这就直接贴出来，为喜欢的朋友省些力气吧。不过我在原代码结构上稍做了一些调整，主要为了能够支持折起与打开的功能，整体看比较类似mg12大人的那个wp_easyarchives插件，虽然不支持年份的选择下拉表，但我个人感觉还是很整齐的。]]></description>
			<content:encoded><![CDATA[<p><a class="thickbox alignleft" href="http://xfuxing.com/wdp/wp-content/uploads/2009/08/archiveslist.png"><img title="archiveslist" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="245" alt="archiveslist" src="http://xfuxing.com/wdp/wp-content/uploads/2009/08/archiveslist_thumb.png" width="168" border="0" /></a>首先声明，这篇文章的源代码来自“偶爱偶家”，本人从“不务正业”处取得源文件下载，呵，不过鉴于两处的下载似乎都链接不上，且原文上并没有直接给出源代码，那么我在这就直接贴出来，为喜欢的朋友省些力气吧。不过我在原代码结构上稍做了一些调整，主要为了能够支持折起与打开的功能，整体看比较类似mg12大人的那个wp_easyarchives插件，虽然不支持年份的选择下拉表，但我个人感觉还是很整齐的。</p>
<p><span id="more-69"></span>
<div class="fixed"></div>
<p>第一步：制作一个函数在functions.php，您可以直接复制如下代码</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">archives_list_SHe</span><span style="color: Olive;">()</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$wpdb</span><span style="color: Gray;">,</span><span style="color: #00008b;">$month</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: #00008b;">$lastpost</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wpdb</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_var</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">SELECT ID FROM </span><span style="color: #00008b;">$wpdb</span><span style="color: Red;">-&gt;posts WHERE post_date &lt;'</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> . </span><span style="color: Blue;">current_time</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">mysql</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">' AND post_status='publish' AND post_type='post' AND post_password='' ORDER BY post_date DESC LIMIT 1</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> = </span><span style="color: Blue;">get_option</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">SHe_archives_</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$lastpost</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Green;">empty</span><span style="color: Olive;">(</span><span style="color: #00008b;">$output</span><span style="color: Olive;">)){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">''</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #00008b;">$wpdb</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">query</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">DELETE FROM </span><span style="color: #00008b;">$wpdb</span><span style="color: Red;">-&gt;options WHERE option_name LIKE 'SHe_archives_%'</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #00008b;">$q</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM </span><span style="color: #00008b;">$wpdb</span><span style="color: Red;">-&gt;posts p WHERE post_date &lt;'</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> . </span><span style="color: Blue;">current_time</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">mysql</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">' AND post_status='publish' AND post_type='post' AND post_password='' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #00008b;">$monthresults</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wpdb</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_results</span><span style="color: Olive;">(</span><span style="color: #00008b;">$q</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$monthresults</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Green;">foreach</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$monthresults</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #00008b;">$monthresult</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$thismonth</span><span style="color: Gray;">&nbsp; &nbsp; = </span><span style="color: Blue;">zeroise</span><span style="color: Olive;">(</span><span style="color: #00008b;">$monthresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">month</span><span style="color: Gray;">, </span><span style="color: Maroon;">2</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$thisyear</span><span style="color: Gray;">&nbsp; &nbsp; = </span><span style="color: #00008b;">$monthresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">year</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$q</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">SELECT ID, post_date, post_title, comment_count FROM </span><span style="color: #00008b;">$wpdb</span><span style="color: Red;">-&gt;posts p WHERE post_date LIKE '</span><span style="color: #00008b;">$thisyear</span><span style="color: Red;">-</span><span style="color: #00008b;">$thismonth</span><span style="color: Red;">-%' AND post_date AND post_status='publish' AND post_type='post' AND post_password='' ORDER BY post_date DESC</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$postresults</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$wpdb</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">get_results</span><span style="color: Olive;">(</span><span style="color: #00008b;">$q</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresults</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$text</span><span style="color: Gray;"> = </span><span style="color: Blue;">sprintf</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">%s %d</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #00008b;">$month</span><span style="color: Olive;">[</span><span style="color: Blue;">zeroise</span><span style="color: Olive;">(</span><span style="color: #00008b;">$monthresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">month</span><span style="color: Gray;">,</span><span style="color: Maroon;">2</span><span style="color: Olive;">)]</span><span style="color: Gray;">, </span><span style="color: #00008b;">$monthresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">year</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$postcount</span><span style="color: Gray;"> = </span><span style="color: Blue;">count</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresults</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> .= </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;dl&gt;&lt;dt&gt;&lt;strong&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #00008b;">$text</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/strong&gt; &amp;nbsp;(</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">count</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresults</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Posts</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">freephp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">)&lt;/dt&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Navy;">\n</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">foreach</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresults</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #00008b;">$postresult</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">post_date</span><span style="color: Gray;"> != </span><span style="color: #8b0000;">'</span><span style="color: Red;">0000-00-00 00:00:00</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$url</span><span style="color: Gray;"> = </span><span style="color: Blue;">get_permalink</span><span style="color: Olive;">(</span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">ID</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$arc_title</span><span style="color: Gray;">&nbsp; &nbsp; = </span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">post_title</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$arc_title</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$text</span><span style="color: Gray;"> = </span><span style="color: Blue;">wptexturize</span><span style="color: Olive;">(</span><span style="color: Blue;">strip_tags</span><span style="color: Olive;">(</span><span style="color: #00008b;">$arc_title</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$text</span><span style="color: Gray;"> = </span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">ID</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$title_text</span><span style="color: Gray;"> = </span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">View this post</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">freephp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">, &amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">wp_specialchars</span><span style="color: Olive;">(</span><span style="color: #00008b;">$text</span><span style="color: Gray;">, </span><span style="color: Maroon;">1</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> .= </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;dd&gt;&lt;em&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: Blue;">mysql2date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">m/d</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">post_date</span><span style="color: Olive;">)</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/em&gt;:&amp;nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">&lt;a href='</span><span style="color: #00008b;">$url</span><span style="color: Red;">' title='</span><span style="color: #00008b;">$title_text</span><span style="color: Red;">'&gt;</span><span style="color: #00008b;">$text</span><span style="color: Red;">&lt;/a&gt;</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> .= </span><span style="color: #8b0000;">'</span><span style="color: Red;">&amp;nbsp;(</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #00008b;">$postresult</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">comment_count</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">'</span><span style="color: Red;">)</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> .= </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/dd&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Navy;">\n</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> .= </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/dl&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Navy;">\n</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">update_option</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">SHe_archives_</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$lastpost</span><span style="color: Gray;">,</span><span style="color: #00008b;">$output</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span><span style="color: Green;">else</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$output</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;div class=&quot;errorbox&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">. </span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Sorry, no posts matched your criteria.</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">freephp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> .</span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/div&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> . </span><span style="color: #8b0000;">&quot;</span><span style="color: Navy;">\n</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Green;">echo</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$output</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">}</span></li>
</ol></div>
<p>第二步：添加如下JS（我这个使用了jQuery库，如果您不喜欢使用此库的话，那么这部份控制折起与打开的JS代码您可以在网上搜索相应的不需jQuery库的。）</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: Teal;">document</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">ready</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">()</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; $</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">#archlist dt</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">each</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">dt</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">objList</span><span style="color: Gray;"> =</span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Teal;">Array</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">tmpDD</span><span style="color: Gray;"> = </span><span style="color: Blue;">dt</span><span style="color: Gray;">.</span><span style="color: Blue;">next</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">while</span><span style="color: Olive;">(</span><span style="color: Blue;">tmpDD</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">tagName</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">!=</span><span style="color: Green;">null</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: Blue;">tmpDD</span><span style="color: Gray;">.</span><span style="color: Blue;">attr</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">tagName</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">!=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">DT</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">objList</span><span style="color: Gray;">.</span><span style="color: Blue;">push</span><span style="color: Olive;">(</span><span style="color: Blue;">tmpDD</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">tmpDD</span><span style="color: Gray;"> = </span><span style="color: Blue;">tmpDD</span><span style="color: Gray;">.</span><span style="color: Blue;">next</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">dt</span><span style="color: Gray;">.</span><span style="color: Blue;">toggle</span><span style="color: Olive;">(</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objList</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">each</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">show</span><span style="color: Olive;">()</span><span style="color: Gray;">;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span><span style="color: Gray;">,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Blue;">objList</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">each</span><span style="color: Olive;">(</span><span style="color: Green;">function</span><span style="color: Olive;">(){</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $</span><span style="color: Olive;">(</span><span style="color: Green;">this</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">hide</span><span style="color: Olive;">()</span><span style="color: Gray;">;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li></ol></div>
<p>第三步：制作archives.php模板页</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">&lt;?php</span></li>
<li><span style="color: #ffa500;">/*</span></li>
<li><span style="color: #ffa500;">Template Name: Archives</span></li>
<li><span style="color: #ffa500;">*/</span></li>
<li><span style="color: Blue;">?&gt;</span></li>
<li><span style="color: Blue;">&lt;?php</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">get_header</span><span style="color: Olive;">()</span><span style="color: Gray;">; </span><span style="color: Blue;">?&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &lt;div id=&quot;content&quot;&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &lt;h2 class=&quot;posttitle&quot;&gt;</span><span style="color: Blue;">&lt;?php</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">_e</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Archives:</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">freephp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: Blue;">?&gt;</span><span style="color: Gray;">&lt;/h2&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &lt;ul id=&quot;archlist&quot;&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">&lt;?php</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">archives_list_SHe</span><span style="color: Olive;">()</span><span style="color: Gray;">; </span><span style="color: Blue;">?&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &lt;/ul&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &lt;/div&gt;</span></li>
<li><span style="color: Blue;">&lt;?php</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">get_sidebar</span><span style="color: Olive;">()</span><span style="color: Gray;">; </span><span style="color: Blue;">?&gt;</span></li>
<li><span style="color: Blue;">&lt;?php</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">get_footer</span><span style="color: Olive;">()</span><span style="color: Gray;">; </span><span style="color: Blue;">?&gt;</span></li></ol></div>
<p>OK，大功告成，去建立一个自己的存档页面吧。当然，您或许还需要通过CSS去修饰一下这个页面，呵，不过那我就帮不上什么忙了，怕是越帮越忙。</p>
<p><a href="http://xfuxing.com/2009/no-plug-ins-to-create-their-own-archive-page.html">Simple happiness</a></p>
<h3  class="related_post_title">您可能感兴趣的文章</h3><ul class="related_post"><li>2009年11月3日 -- <a href="http://xfuxing.com/2009/modify-the-mail-to-commenter-so-that-more-user-friendly-e-mail-notification.html" title="修改 mail to commenter,让邮件通知更加友好">修改 mail to commenter,让邮件通知更加友好</a> (31)</li><li>2009年09月30日 -- <a href="http://xfuxing.com/2009/plug-in-update.html" title="插件更新">插件更新</a> (11)</li><li>2009年09月27日 -- <a href="http://xfuxing.com/2009/about-wordpress-to-qzone.html" title="关于WordPress to Qzone">关于WordPress to Qzone</a> (11)</li><li>2009年09月25日 -- <a href="http://xfuxing.com/2009/with-regard-to-simple-stats-widget-for-wordpress-problems-grasping-the-spider.html" title="关于simple-stats-widget for WordPress抓蜘蛛的问题">关于simple-stats-widget for WordPress抓蜘蛛的问题</a> (0)</li><li>2009年09月24日 -- <a href="http://xfuxing.com/2009/plug-in-released-simple-stats-widget-for-wordpress.html" title="Plug-in released:simple-stats-widget for WordPress">Plug-in released:simple-stats-widget for WordPress</a> (32)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://xfuxing.com/2009/no-plug-ins-to-create-their-own-archive-page.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jquery动感菜单（导航）代码</title>
		<link>http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html</link>
		<comments>http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 02:41:04 +0000</pubDate>
		<dc:creator>德海</dc:creator>
				<category><![CDATA[关注网络]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[导航]]></category>
		<category><![CDATA[菜单]]></category>

		<guid isPermaLink="false">http://xfuxing.com/abc/55</guid>
		<description><![CDATA[其实菜单（或说导航条？）有很多种，不是非要jquery不可，但有时这种菜单确实做得漂亮，虽然我下面这个菜单很简单，也是网上多个例子中的一个，但对我很实用，机制无非是用一张大图做背景，然后通过jquery来步进的移动这张背景图，造成动感。]]></description>
			<content:encoded><![CDATA[<p>其实菜单（或说导航条？）有很多种，不是非要jquery不可，但有时这种菜单确实做得漂亮，虽然我下面这个菜单很简单，也是网上多个例子中的一个，但对我很实用，机制无非是用一张大图做背景，然后通过jquery来步进的移动这张背景图，造成动感。代码中的背景图没有附上，如果您喜欢，可以自己搞一张。大小嘛，199px X 100px。<br />
<span id="more-55"></span><br />
<code><br />
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;<br />
&lt;html lang="en"&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Menu&lt;/title&gt;</p>
<p>&lt;style type="text/css"&gt;<br />
	ul {list-style:none;margin:0;padding:0;}<br />
	li {float:left;width:100px;margin:0;padding:0;text-align:center;}<br />
	li a {display:block;padding:5px 10px;height:100%;color:#FFF;text-decoration:none;border-right:1px solid #FFF;}<br />
	li a {background:url(bg2.jpg) repeat 0 0;}<br />
	li a:hover, li a:focus, li a:active {background-position:-150px 0;}<br />
	#menu a {background:url(bg.jpg) repeat -20px 35px;}</p>
<p>&lt;/style&gt;</p>
<p>&lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;</p>
<p>&lt;script type="text/javascript"&gt;</p>
<p>$(function(){<br />
	$('#menu a')<br />
		.css( {backgroundPosition: "-20px 35px"} )<br />
		.mouseover(function(){<br />
			$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})<br />
		})<br />
		.mouseout(function(){<br />
			$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){<br />
				$(this).css({backgroundPosition: "-20px 35px"})<br />
			}})<br />
		})<br />
});<br />
$(function($) {<br />
	$.extend($.fx.step,{<br />
	    backgroundPosition: function(fx) {<br />
            if (fx.state === 0 &#038;&#038; typeof fx.end == 'string') {<br />
                var start = $.curCSS(fx.elem,'backgroundPosition');<br />
                start = toArray(start);<br />
                fx.start = [start[0],start[2]];<br />
                var end = toArray(fx.end);<br />
                fx.end = [end[0],end[2]];<br />
                fx.unit = [end[1],end[3]];<br />
			}<br />
            var nowPosX = [];<br />
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];<br />
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];<br />
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];</p>
<p>           function toArray(strg){<br />
               strg = strg.replace(/left|top/g,'0px');<br />
               strg = strg.replace(/right|bottom/g,'100%');<br />
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");<br />
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);<br />
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];<br />
           }<br />
        }<br />
	});<br />
});<br />
&lt;/script&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div&gt;<br />
	&lt;ul id="menu"&gt;<br />
		&lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
		&lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;<br />
		&lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;<br />
	&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p><a href="http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html">Simple happiness</a></p>
<h3  class="related_post_title">您可能感兴趣的文章</h3><ul class="related_post"><li>2009年07月22日 -- <a href="http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html" title="jquery滑动回顶部代码">jquery滑动回顶部代码</a> (0)</li><li>2009年07月21日 -- <a href="http://xfuxing.com/2009/jquery-interlacing-color-code.html" title="jquery隔行变色代码">jquery隔行变色代码</a> (0)</li><li>2009年07月19日 -- <a href="http://xfuxing.com/2009/jquery-option-card-code.html" title="jquery选项卡代码">jquery选项卡代码</a> (0)</li><li>2010年08月28日 -- <a href="http://xfuxing.com/2010/php-program-on-the-internationalization-i18n-of-those-things.html" title="关于php程序国际化(i18n)的那些事">关于php程序国际化(i18n)的那些事</a> (2)</li><li>2010年08月27日 -- <a href="http://xfuxing.com/2010/php-remote-file-access-to-information-under-an-important-function-get_headers.html" title="php下获取远程文件信息的重要函数get_headers">php下获取远程文件信息的重要函数get_headers</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery滑动回顶部代码</title>
		<link>http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html</link>
		<comments>http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html#comments</comments>
		<pubDate>Wed, 22 Jul 2009 02:27:02 +0000</pubDate>
		<dc:creator>德海</dc:creator>
				<category><![CDATA[关注网络]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[回顶部]]></category>
		<category><![CDATA[滑动]]></category>

		<guid isPermaLink="false">http://xfuxing.com/abc/54</guid>
		<description><![CDATA[有时候因为网页太长，看到底部的时候再回到最上面的确是让人费劲的事情，拉动滚动条或用鼠标动作，太繁复了。在底部添加一个“返回顶部”的功能确实是不错，方法很多了，可以设锚点，可以用JS，不过这里要说的还是用jquery。代码也是很简单的，就不做说明了。]]></description>
			<content:encoded><![CDATA[<p>有时候因为网页太长，看到底部的时候再回到最上面的确是让人费劲的事情，拉动滚动条或用鼠标动作，太繁复了。在底部添加一个“返回顶部”的功能确实是不错，方法很多了，可以设锚点，可以用JS，不过这里要说的还是用jquery。代码也是很简单的，就不做说明了。<br />
<span id="more-54"></span><br />
<code><br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cn" lang="cn"&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;<br />
&lt;title&gt;Top&lt;/title&gt;</p>
<p>&lt;script src="jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
$(document).ready(function(){<br />
$('.gotop').click(function(){<br />
	$('html, body').animate({scrollTop: 0},300);<br />
});<br />
});<br />
--&gt;<br />
&lt;/script&gt;<br />
&lt;style type="text/css"&gt;</p>
<p>.gotop {<br />
	margin: 0;<br />
	padding: 0 20px;<br />
	height: 31px;<br />
	line-height: 31px;<br />
	border: 1px solid #999;<br />
	overflow: hidden;<br />
	position: relative;<br />
	background: #e0e0e0;<br />
	text-decoration: none;<br />
	color: #000;<br />
	display: block;<br />
	font-size: 1.2em;<br />
	outline: none;<br />
	cursor: hand;<br />
}<br />
#kk {<br />
	height:1000px;<br />
}</p>
<p>&lt;/style&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;TOP!&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;div id="kk"&gt;&lt;/div&gt;<br />
&lt;div&gt;<br />
&lt;ul&gt;<br />
&lt;li class="gotop"&gt;go to top!&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p><a href="http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html">Simple happiness</a></p>
<h3  class="related_post_title">您可能感兴趣的文章</h3><ul class="related_post"><li>2009年07月23日 -- <a href="http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html" title="jquery动感菜单（导航）代码">jquery动感菜单（导航）代码</a> (0)</li><li>2009年07月21日 -- <a href="http://xfuxing.com/2009/jquery-interlacing-color-code.html" title="jquery隔行变色代码">jquery隔行变色代码</a> (0)</li><li>2009年07月19日 -- <a href="http://xfuxing.com/2009/jquery-option-card-code.html" title="jquery选项卡代码">jquery选项卡代码</a> (0)</li><li>2010年08月28日 -- <a href="http://xfuxing.com/2010/php-program-on-the-internationalization-i18n-of-those-things.html" title="关于php程序国际化(i18n)的那些事">关于php程序国际化(i18n)的那些事</a> (2)</li><li>2010年08月27日 -- <a href="http://xfuxing.com/2010/php-remote-file-access-to-information-under-an-important-function-get_headers.html" title="php下获取远程文件信息的重要函数get_headers">php下获取远程文件信息的重要函数get_headers</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery隔行变色代码</title>
		<link>http://xfuxing.com/2009/jquery-interlacing-color-code.html</link>
		<comments>http://xfuxing.com/2009/jquery-interlacing-color-code.html#comments</comments>
		<pubDate>Tue, 21 Jul 2009 02:17:25 +0000</pubDate>
		<dc:creator>德海</dc:creator>
				<category><![CDATA[关注网络]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[隔行变色]]></category>

		<guid isPermaLink="false">http://xfuxing.com/abc/53</guid>
		<description><![CDATA[昨天记下个jquery的选项卡代码，今天继续记。
很多时候我们在评论或li列表里会用到隔行变色以及经过变色这样的功能，这个功能说来比较花哨，但又不失其实用效果，可以有效的缓解视疲劳，以及让观者不至看串行。废话少说，代码在下。]]></description>
			<content:encoded><![CDATA[<p>昨天记下个jquery的选项卡代码，今天继续记。<br />
很多时候我们在评论或li列表里会用到隔行变色以及经过变色这样的功能，这个功能说来比较花哨，但又不失其实用效果，可以有效的缓解视疲劳，以及让观者不至看串行。废话少说，代码在下。<br />
<span id="more-53"></span><br />
<code><br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cn" lang="cn"&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;<br />
&lt;title&gt;Discolor&lt;/title&gt;</p>
<p>&lt;script src="jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
$(document).ready(function(){<br />
	$("#list li:even").addClass("li_bg1");<br />
    $("#list li:odd").addClass("li_bg2");<br />
	$("#list li").hover(function(){<br />
		$(this).addClass("hover");<br />
		},<br />
		function(){<br />
			$(this).removeClass("hover");<br />
		});<br />
});<br />
--&gt;<br />
&lt;/script&gt;<br />
&lt;style type="text/css"&gt;<br />
#list .li_bg1 {<br />
	background:#FFF;<br />
	}<br />
#list .li_bg2 {<br />
	background:#F0F;<br />
	}<br />
#list li.hover {<br />
	background:#0F0;<br />
	}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
	&lt;div&gt;<br />
		&lt;ul id="list"&gt;<br />
			&lt;li&gt;Content of the One!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Two!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Three!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Four!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Five!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Six!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Seven!&lt;/li&gt;<br />
			&lt;li&gt;Content of the Eight!&lt;/li&gt;<br />
		&lt;/ul&gt;<br />
	&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code><br />
代码很简单，不用做什么说明了。</p>
<p><a href="http://xfuxing.com/2009/jquery-interlacing-color-code.html">Simple happiness</a></p>
<h3  class="related_post_title">您可能感兴趣的文章</h3><ul class="related_post"><li>2009年07月23日 -- <a href="http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html" title="jquery动感菜单（导航）代码">jquery动感菜单（导航）代码</a> (0)</li><li>2009年07月22日 -- <a href="http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html" title="jquery滑动回顶部代码">jquery滑动回顶部代码</a> (0)</li><li>2009年07月19日 -- <a href="http://xfuxing.com/2009/jquery-option-card-code.html" title="jquery选项卡代码">jquery选项卡代码</a> (0)</li><li>2010年08月28日 -- <a href="http://xfuxing.com/2010/php-program-on-the-internationalization-i18n-of-those-things.html" title="关于php程序国际化(i18n)的那些事">关于php程序国际化(i18n)的那些事</a> (2)</li><li>2010年08月27日 -- <a href="http://xfuxing.com/2010/php-remote-file-access-to-information-under-an-important-function-get_headers.html" title="php下获取远程文件信息的重要函数get_headers">php下获取远程文件信息的重要函数get_headers</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://xfuxing.com/2009/jquery-interlacing-color-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery选项卡代码</title>
		<link>http://xfuxing.com/2009/jquery-option-card-code.html</link>
		<comments>http://xfuxing.com/2009/jquery-option-card-code.html#comments</comments>
		<pubDate>Sun, 19 Jul 2009 02:54:05 +0000</pubDate>
		<dc:creator>德海</dc:creator>
				<category><![CDATA[关注网络]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[选项卡]]></category>

		<guid isPermaLink="false">http://xfuxing.com/abc/52</guid>
		<description><![CDATA[如今选项卡这种方式可是很热门的，在网上一搜一大片，本着小博有可能会依赖于lightbox2的图片效果，于是搜起了jquery这个JS框架下的相关代码，在查看了N个后，进行整合，于是，下面的代码热气腾腾的出炉了，虽说这样的代码网上比比皆是，但我还是记录下来，如果您凑巧也喜欢，那尽管拿去好了。]]></description>
			<content:encoded><![CDATA[<p>一直想写个漂亮实用的主题，可无奈自己技术不够，甚至可以说是门外汉，虽然前几日依着K2和iNove以及大量的插件差点改出一个主题来，但最终还是放弃了。对于技术，咱这个门外汉还是奉行“拿来主义”吧，一点一点充实之后再厚积薄发。</p>
<p>第一个充实的——选项卡。</p>
<p>如今选项卡这种方式可是很热门的，在网上一搜一大片，本着小博有可能会依赖于lightbox2的图片效果，于是搜起了jquery这个JS框架下的相关代码，在查看了N个后，进行整合，于是，下面的代码热气腾腾的出炉了，虽说这样的代码网上比比皆是，但我还是记录下来，如果您凑巧也喜欢，那尽管拿去好了。<br />
<span id="more-52"></span><br />
<code><br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cn" lang="cn"&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;<br />
&lt;title&gt;Tabs&lt;/title&gt;</p>
<p>&lt;script src="jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
$(document).ready(function() {<br />
	//When page loads<br />
	$(".tab_content").hide(); //Hide all content<br />
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab<br />
	$(".tab_content:first").show(); //Show first tab content</p>
<p>    var $div_li = $("ul.tabs li");<br />
    $div_li.click(function(){<br />
        $(this).addClass("active").siblings().removeClass("active");<br />
        var index =  $div_li.index(this);  //Click access to the current elements in all the &lt;li&gt; elements in the index.<br />
        $("div.tab_container &gt; div").eq(index).show().siblings().hide();<br />
    }).hover(function(){<br />
        $(this).addClass("hover");<br />
    },function(){<br />
        $(this).removeClass("hover");<br />
    });<br />
});<br />
--&gt;<br />
&lt;/script&gt;<br />
&lt;style type="text/css"&gt;<br />
&lt;!-- menu start --&gt;<br />
ul.tabs {<br />
	margin: 0;<br />
	padding: 0;<br />
	float: left;<br />
	list-style: none;<br />
	height: 32px;<br />
	border-bottom: 1px solid #999;<br />
	border-left: 1px solid #999;<br />
	width: 100%;<br />
}<br />
ul.tabs li {<br />
	float: left;<br />
	margin: 0;<br />
	padding: 0 20px;<br />
	height: 31px;<br />
	line-height: 31px;<br />
	border: 1px solid #999;<br />
	border-left: none;<br />
	margin-bottom: -1px;<br />
	overflow: hidden;<br />
	position: relative;<br />
	background: #e0e0e0;<br />
	text-decoration: none;<br />
	color: #000;<br />
	display: block;<br />
	font-size: 1.2em;<br />
	outline: none;<br />
	cursor: hand;<br />
}<br />
ul.tabs li.hover {<br />
	background: #ccc;<br />
}<br />
ul.tabs li.active {<br />
	background: #fff;<br />
	border-bottom: 1px solid #999;<br />
}<br />
&lt;!-- menu end --&gt;<br />
&lt;!-- content start --&gt;<br />
.tab_container {<br />
	border: 1px solid #999;<br />
	border-top: none;<br />
	overflow: hidden;<br />
	clear: both;<br />
	float: left; width: 100%;<br />
	background: #fff;<br />
}<br />
.tab_content {<br />
	padding: 20px;<br />
	font-size: 1.2em;<br />
}<br />
&lt;!-- content end --&gt;<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
	&lt;div class="menu"&gt;<br />
		&lt;ul class="tabs"&gt;<br />
			&lt;li&gt;One&lt;/li&gt;<br />
			&lt;li&gt;Two&lt;/li&gt;<br />
			&lt;li&gt;Three&lt;/li&gt;<br />
		&lt;/ul&gt;<br />
	&lt;/div&gt;</p>
<p>	&lt;div class="tab_container"&gt;<br />
		&lt;div class="tab_content"&gt;<br />
			Content of the One!<br />
		&lt;/div&gt;<br />
		&lt;div class="tab_content"&gt;<br />
			Content of the Two!<br />
		&lt;/div&gt;<br />
		&lt;div class="tab_content"&gt;<br />
			Content of the Three!<br />
		&lt;/div&gt;<br />
	&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code><br />
代码很简单，不做太多说明了，留着备用。<br />
哦，顺便庆祝一下PICASA终于正常了，我儿的照片又能显示了。</p>
<p><a href="http://xfuxing.com/2009/jquery-option-card-code.html">Simple happiness</a></p>
<h3  class="related_post_title">您可能感兴趣的文章</h3><ul class="related_post"><li>2009年07月23日 -- <a href="http://xfuxing.com/2009/jquery-dynamic-menu-navigation-code.html" title="jquery动感菜单（导航）代码">jquery动感菜单（导航）代码</a> (0)</li><li>2009年07月22日 -- <a href="http://xfuxing.com/2009/jquery-sliding-back-to-the-top-of-the-code.html" title="jquery滑动回顶部代码">jquery滑动回顶部代码</a> (0)</li><li>2009年07月21日 -- <a href="http://xfuxing.com/2009/jquery-interlacing-color-code.html" title="jquery隔行变色代码">jquery隔行变色代码</a> (0)</li><li>2010年08月28日 -- <a href="http://xfuxing.com/2010/php-program-on-the-internationalization-i18n-of-those-things.html" title="关于php程序国际化(i18n)的那些事">关于php程序国际化(i18n)的那些事</a> (2)</li><li>2010年08月27日 -- <a href="http://xfuxing.com/2010/php-remote-file-access-to-information-under-an-important-function-get_headers.html" title="php下获取远程文件信息的重要函数get_headers">php下获取远程文件信息的重要函数get_headers</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://xfuxing.com/2009/jquery-option-card-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

