<?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>Life Studio &#187; 电脑网络</title>
	<atom:link href="http://wange.im/category/computer/feed" rel="self" type="application/rss+xml" />
	<link>http://wange.im</link>
	<description>My Life, My Studio...</description>
	<lastBuildDate>Fri, 20 Jan 2012 01:49:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>新年新气象，博客换新衣</title>
		<link>http://wange.im/new-year-new-theme.html</link>
		<comments>http://wange.im/new-year-new-theme.html#comments</comments>
		<pubDate>Fri, 20 Jan 2012 01:27:50 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[万戈]]></category>
		<category><![CDATA[主题]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5239</guid>
		<description><![CDATA[hi，大家好，你没有走错，这里是你们熟悉的万戈 - Life Studio 的博客，新年新气象，博客也要换新衣，距离上一个万戈牌主题，已经整整过去一年了，估计大家看的也有审美疲劳了吧，也是时候换一套新皮肤。首先感谢这次主题的首席设计湿——尘埃老哥（大家不妨去看一下他的网站，也是我做的哟 ^_^），代码部分则由我亲自操刀，HIAHIA~~~ 不过，因为做这个主题的时间比较仓促，又想赶在新年前上线，很多功能还没有完成，真是对不起尘埃老哥的设计呀。大家可以看到，我整个侧边栏还没有做，为了不显得太空空荡荡，就填了一个广告（原来广告还能这么用，嘿嘿）；另外评论模块也没做，暂时用第三方的“评论啦”来代替，感觉也不错，但是昨天导入 WordPress 9W 多条评论的时候让我非常内桑，直到发文前，还在导入 ing....还有很多细枝末节的小功能，可以提升用户体验的就更没有时间做了，各种速度上的优化也只做了一半。所以这个主题。。。呃。。。正处于 beta 的 beta 阶段，拍砖请悠着点，谢谢。 当然，虽然说是各种cuo，但毕竟是万戈牌主题，cuo 也要 cuo 的很有范儿！主题延用之前 HTML5 这是自不必说了，另外还加上了很潮的微数据，让 SEO 尽显奢华，哈哈；在首页的最新文章功能还大胆使用了 AJAX 来异步获取文章，对用户体验应该不错；搜索还提供了关键词自动提示功能；还有很多隐蔽的亮点，大家有兴趣的慢慢找吧。 欢迎各位对这个新主题提出宝贵意见，也欢迎大家来找碴，挑 bug。下午就要赶火车去了，主题的完善工作要等到年后来做了，因为我说了，今年过节不上网。好好过个年，别再为代码纠结了，哦耶~ 最后，预祝大家新年快乐，回家路上顺顺利利 \(^o^)/ 与 HTML5,WordPress,万戈,主题 相关的文章 万戈牌主题上线测试 2011年01月4日 向 HTML5 发起自学挑战书 2010年11月8日 关于 D&#038;Z Theme Pro CP 付费主题 2010年08月1日 万戈修订版 D&#038;Z 主题（二） 2009年12月21日]]></description>
			<content:encoded><![CDATA[<p>hi，大家好，你没有走错，这里是你们熟悉的万戈 - Life Studio 的博客，新年新气象，博客也要换新衣，距离上一个<a title="万戈牌主题上线测试" href="http://wange.im/wange-theme-beta.html">万戈牌主题</a>，已经整整过去一年了，估计大家看的也有审美疲劳了吧，也是时候换一套新皮肤。首先感谢这次主题的首席设计湿——<a title="尘埃影像" href="http://www.dvpoo.com/" rel="nofollow" target="_blank">尘埃</a>老哥（大家不妨去看一下他的网站，也是我做的哟 ^_^），代码部分则由我亲自操刀，HIAHIA~~~</p>
<p>不过，因为做这个主题的时间比较仓促，又想赶在新年前上线，很多功能还没有完成，真是对不起尘埃老哥的设计呀。大家可以看到，我整个侧边栏还没有做，为了不显得太空空荡荡，就填了一个广告（原来广告还能这么用，嘿嘿）；另外评论模块也没做，暂时用第三方的“评论啦”来代替，感觉也不错，但是昨天导入 WordPress 9W 多条评论的时候让我非常内桑，直到发文前，还在导入 ing....还有很多细枝末节的小功能，可以提升用户体验的就更没有时间做了，各种速度上的优化也只做了一半。所以这个主题。。。呃。。。正处于 beta 的 beta 阶段，拍砖请悠着点，谢谢。</p>
<p><img src="http://byfiles.storage.live.com/y1phwvKN02-9ZHI3COMoJ-CLjpzPNvFA9mitfA4iTHQITb5F5M8gpfjUVfZUszT_y5L-BxfVf2iGTE/screenshot.jpg" alt="万戈牌主题" /><br />
当然，虽然说是各种cuo，但毕竟是<strong>万戈牌主题</strong>，cuo 也要 cuo 的很有范儿！主题延用之前 HTML5 这是自不必说了，另外还加上了很潮的<a title="关于微数据" href="http://support.google.com/webmasters/bin/answer.py?hl=zh-Hans&amp;answer=176035&amp;topic=1088472&amp;ctx=topic" rel="nofollow" target="_blank">微数据</a>，让 SEO 尽显奢华，哈哈；在首页的最新文章功能还大胆使用了 AJAX 来异步获取文章，对用户体验应该不错；搜索还提供了关键词自动提示功能；还有很多隐蔽的亮点，大家有兴趣的慢慢找吧。</p>
<p>欢迎各位对这个新主题提出宝贵意见，也欢迎大家来找碴，挑 bug。下午就要赶火车去了，主题的完善工作要等到年后来做了，因为我说了，<a title="今年过节不上网！" href="http://wange.im/no-internet-in-spring-festival.html">今年过节不上网</a>。好好过个年，别再为代码纠结了，哦耶~</p>
<p>最后，预祝大家新年快乐，回家路上顺顺利利 \(^o^)/</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/html5/" title="HTML5" rel="tag">HTML5</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>,<a href="http://wange.im/tag/wange/" title="万戈" rel="tag">万戈</a>,<a href="http://wange.im/tag/theme/" title="主题" rel="tag">主题</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/wange-theme-beta.html" rel="bookmark" title="万戈牌主题上线测试">万戈牌主题上线测试</a>        <div class="rl_date">2011年01月4日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/html5-self-study.html" rel="bookmark" title="向 HTML5 发起自学挑战书">向 HTML5 发起自学挑战书</a>        <div class="rl_date">2010年11月8日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/about-dz-theme-pro-cp.html" rel="bookmark" title="关于 D&#038;Z Theme Pro CP 付费主题">关于 D&#038;Z Theme Pro CP 付费主题</a>        <div class="rl_date">2010年08月1日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/revised-edition-dz-theme-by-wange-2.html" rel="bookmark" title="万戈修订版 D&#038;Z 主题（二）">万戈修订版 D&#038;Z 主题（二）</a>        <div class="rl_date">2009年12月21日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/new-year-new-theme.html/feed</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>基于 jQuery 的图片/文字无缝滚动</title>
		<link>http://wange.im/marquee-scroll.html</link>
		<comments>http://wange.im/marquee-scroll.html#comments</comments>
		<pubDate>Tue, 20 Dec 2011 15:14:53 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[无缝滚动]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5213</guid>
		<description><![CDATA[你知道 jQuery，你也知道图片滚动的效果，但是你知道啥叫无缝滚动不？无缝滚动，就是无缝的滚动！换句话说，无缝滚动就是，图片或者文字下一张下一张地滚动，当滚动到屁股的时候就看到头了，反过来，当滚动到头的时候又能看到屁股了。还是看 DEMO 吧，或许更好理解一些。如你所见，当作为一排图片展示的时候，无缝滚动可以让人有无尽的感觉，页面一下子就充实了。 因为我也不是刻意去写这个 jQuery 的无缝滚动，所以 JS 也没封装过，只提供了几个基本的参数作修改，只能仅作参考。 HTML 部分： &#60;div class=&#34;scroll_area&#34;&#62; &#160;&#160;&#160; &#60;div class=&#34;scroll_list&#34;&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;ul class=&#34;scroll_ul&#34;&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;1&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;2&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;3&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;4&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;5&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;6&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;7&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;8&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;li&#62;9&#60;/li&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/ul&#62; &#160;&#160;&#160; &#60;/div&#62; &#160;&#160;&#160; &#60;a id=&#34;prev&#34; class=&#34;btn_icon&#34; href=&#34;javascript:;&#34;&#62;上一个&#60;/a&#62; &#160;&#160;&#160; &#60;a id=&#34;next&#34; class=&#34;btn_icon&#34; href=&#34;javascript:;&#34;&#62;下一个&#60;/a&#62; &#60;/div&#62; jQuery 部分： $(function() [...]]]></description>
			<content:encoded><![CDATA[<p>你知道 jQuery，你也知道图片滚动的效果，但是你知道啥叫无缝滚动不？无缝滚动，就是无缝的滚动！换句话说，无缝滚动就是，图片或者文字下一张下一张地滚动，当滚动到屁股的时候就看到头了，反过来，当滚动到头的时候又能看到屁股了。还是看 <a title="jQuery 无缝滚动" href="http://wange.im/demo/marquee/">DEMO</a> 吧，或许更好理解一些。如你所见，当作为一排图片展示的时候，无缝滚动可以让人有无尽的感觉，页面一下子就充实了。</p>
<p>因为我也不是刻意去写这个 jQuery 的无缝滚动，所以 JS 也没封装过，只提供了几个基本的参数作修改，只能仅作参考。</p>
<p>HTML 部分：</p>
<div style='color: rgb(0, 0, 0); font-family: "Courier New","Consolas","Lucida Console";' class="source"> <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;div</span> <span style="color: rgb(255, 0, 0);">class=</span><span style="color: rgb(0, 0, 255);">&quot;scroll_area&quot;</span><span style="color: rgb(0, 0, 128); font-weight: bold;">&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;div</span> <span style="color: rgb(255, 0, 0);">class=</span><span style="color: rgb(0, 0, 255);">&quot;scroll_list&quot;</span><span style="color: rgb(0, 0, 128); font-weight: bold;">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;ul</span> <span style="color: rgb(255, 0, 0);">class=</span><span style="color: rgb(0, 0, 255);">&quot;scroll_ul&quot;</span><span style="color: rgb(0, 0, 128); font-weight: bold;">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>1<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>2<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>3<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>4<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>5<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>6<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>7<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>8<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;li&gt;</span>9<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/li&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/ul&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/div&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;a</span> <span style="color: rgb(255, 0, 0);">id=</span><span style="color: rgb(0, 0, 255);">&quot;prev&quot;</span> <span style="color: rgb(255, 0, 0);">class=</span><span style="color: rgb(0, 0, 255);">&quot;btn_icon&quot;</span> <span style="color: rgb(255, 0, 0);">href=</span><span style="color: rgb(0, 0, 255);">&quot;javascript:;&quot;</span><span style="color: rgb(0, 0, 128); font-weight: bold;">&gt;</span>上一个<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/a&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;a</span> <span style="color: rgb(255, 0, 0);">id=</span><span style="color: rgb(0, 0, 255);">&quot;next&quot;</span> <span style="color: rgb(255, 0, 0);">class=</span><span style="color: rgb(0, 0, 255);">&quot;btn_icon&quot;</span> <span style="color: rgb(255, 0, 0);">href=</span><span style="color: rgb(0, 0, 255);">&quot;javascript:;&quot;</span><span style="color: rgb(0, 0, 128); font-weight: bold;">&gt;</span>下一个<span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/a&gt;</span><br /> <span style="color: rgb(0, 0, 128); font-weight: bold;">&lt;/div&gt;</span></div>
<p>jQuery 部分：</p>
<div style='color: rgb(0, 0, 0); font-family: "Courier New","Consolas","Lucida Console";' class="source"> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//配置变量</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">config</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">showNum</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">3</span><span style="color: rgb(0, 0, 0);">,</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//设置滚动的显示个数</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">autoScroll</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">false</span><span style="color: rgb(0, 0, 0);">,</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//是否自动滚动，默认为 false</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">autoScrollInterval</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">3000</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//自动滚动间隔，默认为 3000 毫秒，autoScroll = true 时才有效</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul li&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">outerWidth</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">true</span><span style="color: rgb(0, 0, 0);">),</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//单个 li 的宽度</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">0</span><span style="color: rgb(0, 0, 0);">,</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//.scroll_ul 初使化时的 left 值为 0</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">prevAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span><span style="color: rgb(0, 0, 0);">,</span>&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//为了防止连续点击上一页按钮</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">nextAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span>;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//为了防止连续点击下一页按钮</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//计算父容量限宽</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_list&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">width</span>(<span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">showNum</span> <span style="color: rgb(0, 0, 0);">*</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span>);</p>
<p> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//点击上一页</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#prev&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">click</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">prevAllow</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">prevAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">false</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">-</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">css</span>(<span style="color: rgb(0, 0, 255);">&#39;left&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//复制最后一个 li 并插入到 ul 的最前面</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul li:last&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">clone</span><span style="color: rgb(0, 0, 0);">().</span><span style="color: rgb(0, 0, 0);">prependTo</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//删除最后一个 li</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul li:last&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">remove</span>();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">animate</span><span style="color: rgb(0, 0, 0);">({</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">left</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">},</span> <span style="color: rgb(0, 0, 255);">300</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">parseInt</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">css</span>(<span style="color: rgb(0, 0, 255);">&#39;left&#39;</span><span style="color: rgb(0, 0, 0);">),</span> <span style="color: rgb(0, 0, 255);">10</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">prevAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">})</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">});</span><br /> &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//点击下一页</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#next&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">click</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">nextAllow</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">nextAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">false</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">animate</span><span style="color: rgb(0, 0, 0);">({</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">left</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">-</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">},</span> <span style="color: rgb(0, 0, 255);">300</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">parseInt</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">css</span>(<span style="color: rgb(0, 0, 255);">&#39;left&#39;</span><span style="color: rgb(0, 0, 0);">),</span> <span style="color: rgb(0, 0, 255);">10</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">scrollUlWidth</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">css</span>(<span style="color: rgb(0, 0, 255);">&#39;left&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">scrollUlLeft</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//复制第一个 li 并插入到 ul 的最后面</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul li:first&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">clone</span><span style="color: rgb(0, 0, 0);">().</span><span style="color: rgb(0, 0, 0);">appendTo</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//删除第一个 li</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.scroll_ul li:first&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">remove</span>();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">nextAllow</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">})</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">});</span><br /> &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//自动滚动</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">autoScroll</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">setInterval</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#next&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">trigger</span>(<span style="color: rgb(0, 0, 255);">&#39;click&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">},</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">autoScrollInterval</span>)<br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> <span style="color: rgb(0, 0, 0);">})</span></div>
<p>基本原理和使用方法都写在注释里了，我也就不多作解释了。最后说一句，google、百度上搜一下就知道，已经有大把大把写好的横的竖的无缝的滚动，总有一款适合你，但是我觉得，只有自己亲自写的才最适合自己的需要，所以就有了以上代码。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/jquery/" title="jQuery" rel="tag">jQuery</a>,<a href="http://wange.im/tag/picture/" title="图片" rel="tag">图片</a>,<a href="http://wange.im/tag/marquee-scroll/" title="无缝滚动" rel="tag">无缝滚动</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-highslide-on-demand.html" rel="bookmark" title="jQuery 按需加载 HighSlide 效果">jQuery 按需加载 HighSlide 效果</a>        <div class="rl_date">2011年10月10日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-js-ajax-pic.html" rel="bookmark" title="jQuery/JavaScript 实现的异步加载图片">jQuery/JavaScript 实现的异步加载图片</a>        <div class="rl_date">2011年04月10日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/fadeto-effect-with-jquery.html" rel="bookmark" title="利用 JQuery 实现图片显隐特效">利用 JQuery 实现图片显隐特效</a>        <div class="rl_date">2010年04月8日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-slide-pic-show.html" rel="bookmark" title="JQuery 实现带滑动层的图片展示效果">JQuery 实现带滑动层的图片展示效果</a>        <div class="rl_date">2010年02月24日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/marquee-scroll.html/feed</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>给 WordPress 添加语音搜索功能</title>
		<link>http://wange.im/x-webkit-speech-in-wordpress.html</link>
		<comments>http://wange.im/x-webkit-speech-in-wordpress.html#comments</comments>
		<pubDate>Sun, 04 Dec 2011 10:35:42 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[搜索]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5194</guid>
		<description><![CDATA[相信大家都用过 Google 的搜索，不知道大家有没有注意到 Google.com in English 版本的搜索有一个语音搜索，只要吐字清晰，它的识别力还是很高的，而且也只支持中文的语音，这对于老年人、残障人士、偷懒人群是一个非常有用的装B功能。今天心血来潮，把此功能搬到 WordPress。 就本站现在用的这个主题来说，已经用上了这个 WordPress 的语音搜索功能，有图为证。 可以看到右上角的站内搜索框比以往多了一个小话筒的图标，点击之后就会弹出一个小的提示框，此时可以清晰地说出你需要搜索的关键词，截图中是我语音说的 "wordpress" 这个关键词，有兴趣的朋友可以拿本站做测试。 但是，这个功能暂时只能在 Chrome 11 版本以上的谷歌浏览器上看到这个效果。因为这是在 input 输入框里添加 x-webkit-speech 属性来实现的，从这个属性的命名可以看出，webkit，这是一个 webkit 核心浏览器的私有属性，所以你可以切换到 Chrome 浏览器来测试本功能。 x-webkit-speech 是 html5 的 speech 功能的 API，Google 的 Chrome 在对 HTML5、CSS3 的新技术标准的支持上特别积极，所以很有幸，我们可以在 Chrome 上体现各种新奇的功能特性。实现的方法也特别简单，在你的搜索输入框的 input 标签里添加 x-webkit-speech 属性即可，如下： &#60;input type="text" x-webkit-speech /&#62; 废话很多，但是代码却很简单，赶紧试试呗~ 与 API,Chrome,HTML5,WordPress,搜索,浏览器 相关的文章 CSS3 鼠标悬停图片动画效果 2009年09月6日 [...]]]></description>
			<content:encoded><![CDATA[<p>相信大家都用过 Google 的搜索，不知道大家有没有注意到 Google.com in English 版本的搜索有一个语音搜索，只要吐字清晰，它的识别力还是很高的，而且也只支持中文的语音，这对于老年人、残障人士、偷懒人群是一个非常有用的装B功能。今天心血来潮，把此功能搬到 WordPress。</p>
<p>就本站现在用的这个主题来说，已经用上了这个 WordPress 的语音搜索功能，有图为证。</p>
<p><img style="float: left;" src="http://byfiles.storage.live.com/y1p68_Q6wFqvO3nCwGTPzD-6fr-4jfoOPLBv7mPLsC2Lp9nRZRuuL2tMVk2dhLGunYnXr8u4pg1Ge4/speech.jpg" alt="" />可以看到右上角的站内搜索框比以往多了一个小话筒的图标，点击之后就会弹出一个小的提示框，此时可以清晰地说出你需要搜索的关键词，截图中是我语音说的 "wordpress" 这个关键词，有兴趣的朋友可以拿本站做测试。</p>
<p>但是，这个功能暂时只能在 Chrome 11 版本以上的谷歌浏览器上看到这个效果。因为这是在 input 输入框里添加 x-webkit-speech 属性来实现的，从这个属性的命名可以看出，webkit，这是一个 webkit 核心浏览器的私有属性，所以你可以切换到 Chrome 浏览器来测试本功能。</p>
<p>x-webkit-speech 是 html5 的 speech 功能的 API，Google 的 Chrome 在对 HTML5、CSS3 的新技术标准的支持上特别积极，所以很有幸，我们可以在 Chrome 上体现各种新奇的功能特性。实现的方法也特别简单，在你的搜索输入框的 input 标签里添加 x-webkit-speech 属性即可，如下：</p>
<div class="source" style="font-family: 'Courier New', 'Consolas', 'Lucida Console'; color: #000000;"><span style="color: #000080; font-weight: bold;">&lt;input</span> <span style="color: #ff0000;">type=</span><span style="color: #0000ff;">"text"</span> <span style="color: #ff0000;">x-webkit-speech</span> <span style="color: #000080; font-weight: bold;">/&gt;</span></div>
<p>废话很多，但是代码却很简单，赶紧试试呗~</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/api/" title="API" rel="tag">API</a>,<a href="http://wange.im/tag/chrome/" title="Chrome" rel="tag">Chrome</a>,<a href="http://wange.im/tag/html5/" title="HTML5" rel="tag">HTML5</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>,<a href="http://wange.im/tag/search/" title="搜索" rel="tag">搜索</a>,<a href="http://wange.im/tag/browser/" title="浏览器" rel="tag">浏览器</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/css.png&amp;h=45&amp;w=45&amp;zc=1" alt="CSS3 鼠标悬停图片动画效果" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/css-3-hover-animations.html" rel="bookmark" title="CSS3 鼠标悬停图片动画效果">CSS3 鼠标悬停图片动画效果</a>        <div class="rl_date">2009年09月6日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/screenshot.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="新年新气象，博客换新衣" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/new-year-new-theme.html" rel="bookmark" title="新年新气象，博客换新衣">新年新气象，博客换新衣</a>        <div class="rl_date">2012年01月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/w3c-is-in-progress.html" rel="bookmark" title="W3C 规则也在与时俱进？！">W3C 规则也在与时俱进？！</a>        <div class="rl_date">2011年01月22日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/wange-theme-beta.html" rel="bookmark" title="万戈牌主题上线测试">万戈牌主题上线测试</a>        <div class="rl_date">2011年01月4日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/x-webkit-speech-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>84</slash:comments>
		</item>
		<item>
		<title>WordPress 将选中文字转发到微博</title>
		<link>http://wange.im/wordpress-share-selected-text-to-weibo.html</link>
		<comments>http://wange.im/wordpress-share-selected-text-to-weibo.html#comments</comments>
		<pubDate>Sat, 29 Oct 2011 23:19:45 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[QQ]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[微博]]></category>
		<category><![CDATA[新浪]]></category>
		<category><![CDATA[腾讯]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5152</guid>
		<description><![CDATA[最近在看腾讯新闻的时候，无意中发现，当我选中新闻中的文字的时候，鼠标右上角会显示一个“转播至微博”的按钮，点击后就会将选中的文字转发到微博上。这是一个很不错的用户体验，如果能把它引入到 WordPress 博客中，那不是很好吗？ 为此我还特地去注册了一个腾讯微博开放平台的开发者，当我开始阅读开发文档的时候，才发现，他妹的，腾讯官方已经推出一个相同功能的应用，叫作 “Q-Share”，再翻阅了一下其他资料，原来已经有前辈写出了 js 页面文字选中后分享到新浪微博的方法，那我就省力多了，两者结合一下，把新浪微博和腾讯微博两个按钮都加上了，然后闲的蛋疼的我又把它翻译成了 jQuery 的方法。 效果的话就可以看本站了，选中任何文字，就会在右上角显示两个微博按钮，点击试试吧。 实现的方法也很简单，只需要两步： 1、引入 jQuery，相信大多数 WordPress 博客都已经引入了 jQuery，那就可以直接进行第二步了。 2、在页面底部，或者更确切的说，在引入 jQuery 库的后面加上这样一段 JS，你就可以看到和本站一样的效果了。 var miniBlogShare = function() {     //指定位置驻入节点     $('&#60;img id="imgSinaShare" class="img_share" title="将选中内容分享到新浪微博" src="http://wange.im/wp-content/themes/wange/images/sina_share.gif" /&#62;&#60;img id="imgQqShare" class="img_share" title="将选中内容分享到腾讯微博" src="http://wange.im/wp-content/themes/wange/images/tt_share.png" /&#62;').appendTo('body');         //默认样式     $('.img_share').css({         display : 'none',         position : 'absolute',         cursor : [...]]]></description>
			<content:encoded><![CDATA[<p>最近在看腾讯新闻的时候，无意中发现，当我选中新闻中的文字的时候，鼠标右上角会显示一个“转播至微博”的按钮，点击后就会将选中的文字转发到微博上。这是一个很不错的用户体验，如果能把它引入到 WordPress 博客中，那不是很好吗？</p>
<p>为此我还特地去注册了一个腾讯微博开放平台的开发者，当我开始阅读开发文档的时候，才发现，他妹的，腾讯官方已经推出一个相同功能的应用，叫作 “Q-Share”，再翻阅了一下其他资料，原来已经有前辈写出了 <a title="页面选中文字分享到新浪微博实例页面" href="http://www.zhangxinxu.com/study/201102/text-selected-share-sina-miniblog.html" rel="external nofollow" target="_blank">js 页面文字选中后分享到新浪微博</a>的方法，那我就省力多了，两者结合一下，把新浪微博和腾讯微博两个按钮都加上了，然后闲的蛋疼的我又把它翻译成了 jQuery 的方法。</p>
<p>效果的话就可以看本站了，选中任何文字，就会在右上角显示两个微博按钮，点击试试吧。</p>
<p>实现的方法也很简单，只需要两步：</p>
<p>1、引入 jQuery，相信大多数 WordPress 博客都已经引入了 jQuery，那就可以直接进行第二步了。</p>
<p>2、在页面底部，或者更确切的说，在引入 jQuery 库的后面加上这样一段 JS，你就可以看到和本站一样的效果了。</p>
<div class="source" style="font-family: 'Courier New','Consolas','Lucida Console'; color: #000000;"><span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">miniBlogShare</span> <span style="color: #000000;">=</span> <span style="color: #000080; font-weight: bold;">function</span>() <span style="color: #000000;">{</span><br />
    <span style="font-style: italic; color: #008800;">//指定位置驻入节点</span><br />
    <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'&lt;img id="imgSinaShare" class="img_share" title="将选中内容分享到新浪微博" src="http://wange.im/wp-content/themes/wange/images/sina_share.gif" /&gt;&lt;img id="imgQqShare" class="img_share" title="将选中内容分享到腾讯微博" src="http://wange.im/wp-content/themes/wange/images/tt_share.png" /&gt;'</span><span style="color: #000000;">).</span><span style="color: #000000;">appendTo</span>(<span style="color: #0000ff;">'body'</span>);<br />
   <br />
    <span style="font-style: italic; color: #008800;">//默认样式</span><br />
    <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'.img_share'</span><span style="color: #000000;">).</span><span style="color: #000000;">css</span><span style="color: #000000;">({</span><br />
        <span style="color: #000000;">display</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">'none'</span><span style="color: #000000;">,</span><br />
        <span style="color: #000000;">position</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">'absolute'</span><span style="color: #000000;">,</span><br />
        <span style="color: #000000;">cursor</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">'pointer'</span><br />
    <span style="color: #000000;">});</span><br />
   <br />
    <span style="font-style: italic; color: #008800;">//选中文字</span><br />
    <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">funGetSelectTxt</span> <span style="color: #000000;">=</span> <span style="color: #000080; font-weight: bold;">function</span>() <span style="color: #000000;">{</span><br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">''</span>;<br />
        <span style="color: #000080; font-weight: bold;">if</span>(<span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">selection</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">selection</span><span style="color: #000000;">.</span><span style="color: #000000;">createRange</span><span style="color: #000000;">().</span><span style="color: #000000;">text</span>;<br />
        <span style="color: #000000;">}</span> <span style="color: #000080; font-weight: bold;">else</span> <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">getSelection</span>();<br />
        <span style="color: #000000;">}</span><br />
        <span style="color: #000080; font-weight: bold;">return</span> <span style="color: #000000;">txt</span><span style="color: #000000;">.</span><span style="color: #000000;">toString</span>();<br />
    <span style="color: #000000;">};</span><br />
   <br />
    <span style="font-style: italic; color: #008800;">//选中文字后显示微博图标</span><br />
    <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'html,body'</span><span style="color: #000000;">).</span><span style="color: #000000;">mouseup</span>(<span style="color: #000080; font-weight: bold;">function</span>(<span style="color: #000000;">e</span>) <span style="color: #000000;">{</span><br />
        <span style="color: #000080; font-weight: bold;">if</span> (<span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">target</span><span style="color: #000000;">.</span><span style="color: #000000;">id</span> <span style="color: #000000;">==</span> <span style="color: #0000ff;">'imgSinaShare'</span> || <span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">target</span><span style="color: #000000;">.</span><span style="color: #000000;">id</span> <span style="color: #000000;">==</span> <span style="color: #0000ff;">'imgQqShare'</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000080; font-weight: bold;">return</span><br />
        <span style="color: #000000;">}</span><br />
        <span style="color: #000000;">e</span> <span style="color: #000000;">=</span> <span style="color: #000000;">e</span> || <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">event</span>;<br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #000000;">funGetSelectTxt</span><span style="color: #000000;">(),</span><br />
            <span style="color: #000000;">sh</span> <span style="color: #000000;">=</span> <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">pageYOffset</span> || <span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">documentElement</span><span style="color: #000000;">.</span><span style="color: #000000;">scrollTop</span> || <span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">body</span><span style="color: #000000;">.</span><span style="color: #000000;">scrollTop</span> || <span style="color: #0000ff;">0</span><span style="color: #000000;">,</span><br />
            <span style="color: #000000;">left</span> <span style="color: #000000;">=</span> (<span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientX</span> <span style="color: #000000;">-</span> <span style="color: #0000ff;">40</span> <span style="color: #000000;">&lt;</span> <span style="color: #0000ff;">0</span>) <span style="color: #000000;">?</span> <span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientX</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">20</span> <span style="color: #000000;">:</span> <span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientX</span> <span style="color: #000000;">-</span> <span style="color: #0000ff;">40</span><span style="color: #000000;">,</span><br />
            <span style="color: #000000;">top</span> <span style="color: #000000;">=</span> (<span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientY</span> <span style="color: #000000;">-</span> <span style="color: #0000ff;">40</span> <span style="color: #000000;">&lt;</span> <span style="color: #0000ff;">0</span>) <span style="color: #000000;">?</span> <span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientY</span> <span style="color: #000000;">+</span> <span style="color: #000000;">sh</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">20</span> <span style="color: #000000;">:</span> <span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientY</span> <span style="color: #000000;">+</span> <span style="color: #000000;">sh</span> <span style="color: #000000;">-</span> <span style="color: #0000ff;">40</span>;<br />
        <span style="color: #000080; font-weight: bold;">if</span> (<span style="color: #000000;">txt</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgSinaShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">css</span><span style="color: #000000;">({</span><br />
                <span style="color: #000000;">display</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">'inline'</span><span style="color: #000000;">,</span><br />
                <span style="color: #000000;">left</span> <span style="color: #000000;">:</span> <span style="color: #000000;">left</span><span style="color: #000000;">,</span><br />
                <span style="color: #000000;">top</span> <span style="color: #000000;">:</span> <span style="color: #000000;">top</span><br />
            <span style="color: #000000;">});</span><br />
            <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgQqShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">css</span><span style="color: #000000;">({</span><br />
                <span style="color: #000000;">display</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">'inline'</span><span style="color: #000000;">,</span><br />
                <span style="color: #000000;">left</span> <span style="color: #000000;">:</span> <span style="color: #000000;">left</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">30</span><span style="color: #000000;">,</span><br />
                <span style="color: #000000;">top</span> <span style="color: #000000;">:</span> <span style="color: #000000;">top</span><br />
            <span style="color: #000000;">});</span><br />
        <span style="color: #000000;">}</span> <span style="color: #000080; font-weight: bold;">else</span> <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgSinaShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">css</span>(<span style="color: #0000ff;">'display'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'none'</span>);<br />
            <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgQqShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">css</span>(<span style="color: #0000ff;">'display'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'none'</span>);<br />
        <span style="color: #000000;">}</span><br />
    <span style="color: #000000;">});</span><br />
   <br />
    <span style="font-style: italic; color: #008800;">//点击新浪微博</span><br />
    <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgSinaShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">click</span>(<span style="color: #000080; font-weight: bold;">function</span>() <span style="color: #000000;">{</span><br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #000000;">funGetSelectTxt</span><span style="color: #000000;">(),</span> <span style="color: #000000;">title</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'title'</span><span style="color: #000000;">).</span><span style="color: #000000;">html</span>();<br />
        <span style="color: #000080; font-weight: bold;">if</span> (<span style="color: #000000;">txt</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">open</span>(<span style="color: #0000ff;">'http://v.t.sina.com.cn/share/share.php?title='</span> <span style="color: #000000;">+</span> <span style="color: #000000;">txt</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">' —— 转载自：'</span> <span style="color: #000000;">+</span> <span style="color: #000000;">title</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">'&amp;url='</span> <span style="color: #000000;">+</span> <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">location</span><span style="color: #000000;">.</span><span style="color: #000000;">href</span>);<br />
        <span style="color: #000000;">}</span><br />
    <span style="color: #000000;">});</span><br />
   <br />
    <span style="font-style: italic; color: #008800;">//点击腾讯微博</span><br />
    <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'#imgQqShare'</span><span style="color: #000000;">).</span><span style="color: #000000;">click</span>(<span style="color: #000080; font-weight: bold;">function</span>() <span style="color: #000000;">{</span><br />
        <span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">txt</span> <span style="color: #000000;">=</span> <span style="color: #000000;">funGetSelectTxt</span><span style="color: #000000;">(),</span> <span style="color: #000000;">title</span> <span style="color: #000000;">=</span> <span style="color: #000000;">$</span>(<span style="color: #0000ff;">'title'</span><span style="color: #000000;">).</span><span style="color: #000000;">html</span>();<br />
        <span style="color: #000080; font-weight: bold;">if</span> (<span style="color: #000000;">txt</span>) <span style="color: #000000;">{</span><br />
            <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">open</span>(<span style="color: #0000ff;">'http://v.t.qq.com/share/share.php?title='</span> <span style="color: #000000;">+</span> <span style="color: #000000;">encodeURIComponent</span>(<span style="color: #000000;">txt</span> <span style="color: #000000;">+</span> <span style="color: #0000ff;">' —— 转载自：'</span> <span style="color: #000000;">+</span> <span style="color: #000000;">title</span>) <span style="color: #000000;">+</span> <span style="color: #0000ff;">'&amp;url='</span> <span style="color: #000000;">+</span> <span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">location</span><span style="color: #000000;">.</span><span style="color: #000000;">href</span>);<br />
        <span style="color: #000000;">}</span><br />
    <span style="color: #000000;">});</span><br />
<span style="color: #000000;">}();</span></div>
<p>是不是很简单呀？</p>
<p>赶紧选中本文的标题，在微博上通知你的好友来围观吧，哈哈~</p>
<p><img src="http://byfiles.storage.live.com/y1pbpmnSpy4Pja6i0ie8UhJQntR6oaADKG8tRbhlfYsiXc21tQ02IWZ-4_h53-v8radfgLxl33jnVU/weibo_share.jpg" alt="" /></p>
<p>PS：最后，说一句，其实这个方法不仅仅适用于 WordPress，JS 是通用的，你可以把这段 JS 挂载到任何网站上都可以得到相同的效果 <img src='http://wange.im/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>PS2：最最最后，再说一句，麻烦各位在使用前，把 JS 里的两张微博的图片路径替换成自己的地址，因为小站流量有限，大家帮我省着点花呗，嘿嘿。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/js/" title="JS" rel="tag">JS</a>,<a href="http://wange.im/tag/qq/" title="QQ" rel="tag">QQ</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>,<a href="http://wange.im/tag/micr-bo/" title="微博" rel="tag">微博</a>,<a href="http://wange.im/tag/sina/" title="新浪" rel="tag">新浪</a>,<a href="http://wange.im/tag/tencent/" title="腾讯" rel="tag">腾讯</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=&amp;h=45&amp;w=45&amp;zc=1" alt="微博认证，勾与火的考验" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/microblog-certification.html" rel="bookmark" title="微博认证，勾与火的考验">微博认证，勾与火的考验</a>        <div class="rl_date">2011年03月27日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=&amp;h=45&amp;w=45&amp;zc=1" alt="QQ 微博初体验" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/t-qq-com.html" rel="bookmark" title="QQ 微博初体验">QQ 微博初体验</a>        <div class="rl_date">2010年04月15日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=&amp;h=45&amp;w=45&amp;zc=1" alt="腾讯牌操作系统离我们还有多远？" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/tencent-webos.html" rel="bookmark" title="腾讯牌操作系统离我们还有多远？">腾讯牌操作系统离我们还有多远？</a>        <div class="rl_date">2011年04月21日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=&amp;h=45&amp;w=45&amp;zc=1" alt="非插件同步 WordPress 日志到嘀咕" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/sync-wordpress-to-digu.html" rel="bookmark" title="非插件同步 WordPress 日志到嘀咕">非插件同步 WordPress 日志到嘀咕</a>        <div class="rl_date">2011年03月31日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/wordpress-share-selected-text-to-weibo.html/feed</wfw:commentRss>
		<slash:comments>114</slash:comments>
		</item>
		<item>
		<title>jQuery 按需加载 HighSlide 效果</title>
		<link>http://wange.im/jquery-highslide-on-demand.html</link>
		<comments>http://wange.im/jquery-highslide-on-demand.html#comments</comments>
		<pubDate>Mon, 10 Oct 2011 14:09:48 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[HighSlide]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[轮播图]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5132</guid>
		<description><![CDATA[从本文标题可知，这篇文章和上一篇的《jQuery 按需加载轮播图》有着说不清道不明的关系，是的，我就他瞄的和按需加载较上劲了，用 jQuery 来做 HighSlide 的插件已经有不少了，我再横插一脚就是为了这个按需加载，而且还要做到最精简最优化。做这个的理由和上一篇文章中提到的基本一样，第一，为了加载速度的大大提升；第二，为了满足 SEO 的需求。 相信大多数同学，包括我在内，用到的图片 HighSlide 效果都是用的 WordPress 的插件，或者引的 jQuery 的插件，但是这必竟不能完全满足我的需求，而且在我看来那些 JS 也太庞大了一些，还不如自己写一个。做了一个简单的 DEMO，大家可以看一下。 如果你会用 Firebug 这样的工具，就可以看到，页面中所有的图片，包括 DOM 节点，都是通过 JS 注入进来的，而且在初使化的时候只生成当前显示的五组图片，只有当用户点击下一张或者点击图片放大时，才会有新的图片和节点加载进来，同样，如果用户不点击，就不会去加载。这就大大节省了初使化需要加载的图片数量。 在 JS 没有压缩之前，也只有区区 6K 的大小，所以我相信这是大多数用户和站长都能够接受的，不过虽说只有 6K，也有近 200 行的代码，篇幅有限，我就不把具体的 JS 和 CSS 贴出来了，有需要的朋友可以直接下载我的 DEMO，DEMO 里的 JS 没有压缩，注释也都写的比较清楚。 最终效果和现在我用的差不多，但是代码却千差万别，细节决定成败，争取做好每一个细节！ 与 HighSlide,jQuery,图片,轮播图 相关的文章 基于 jQuery 的图片/文字无缝滚动 2011年12月20日 jQuery 按需加载轮播图 2011年09月26日 jQuery/JavaScript 实现的异步加载图片 2011年04月10日 利用 [...]]]></description>
			<content:encoded><![CDATA[<p>从本文标题可知，这篇文章和上一篇的《<a title="jQuery 按需加载轮播图" href="http://wange.im/jquery-slide-loaded-on-demand.html">jQuery 按需加载轮播图</a>》有着说不清道不明的关系，是的，我就他瞄的和<strong>按需加载</strong>较上劲了，用 jQuery 来做 HighSlide 的插件已经有不少了，我再横插一脚就是为了这个按需加载，而且还要做到最精简最优化。做这个的理由和上一篇文章中提到的基本一样，第一，为了加载速度的大大提升；第二，为了满足 SEO 的需求。</p>
<p>相信大多数同学，包括我在内，用到的图片 HighSlide 效果都是用的 WordPress 的插件，或者引的 jQuery 的插件，但是这必竟不能完全满足我的需求，而且在我看来那些 JS 也太庞大了一些，还不如自己写一个。做了一个简单的 <a title="jQuery 按需加载 HighSlide 效果" href="http://wange.im/demo/highslide/">DEMO</a>，大家可以看一下。</p>
<p>如果你会用 Firebug 这样的工具，就可以看到，页面中所有的图片，包括 DOM 节点，都是通过 JS 注入进来的，而且在初使化的时候只生成当前显示的五组图片，只有当用户点击下一张或者点击图片放大时，才会有新的图片和节点加载进来，同样，如果用户不点击，就不会去加载。这就大大节省了初使化需要加载的图片数量。</p>
<p>在 JS 没有压缩之前，也只有区区 6K 的大小，所以我相信这是大多数用户和站长都能够接受的，不过虽说只有 6K，也有近 200 行的代码，篇幅有限，我就不把具体的 JS 和 CSS 贴出来了，有需要的朋友可以直接下载我的 <a title="jQuery 按需加载 HighSlide 效果" href="http://wange.im/demo/highslide/">DEMO</a>，DEMO 里的 JS 没有压缩，注释也都写的比较清楚。</p>
<p>最终效果和现在我用的差不多，但是代码却千差万别，细节决定成败，争取做好每一个细节！</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/highslide/" title="HighSlide" rel="tag">HighSlide</a>,<a href="http://wange.im/tag/jquery/" title="jQuery" rel="tag">jQuery</a>,<a href="http://wange.im/tag/picture/" title="图片" rel="tag">图片</a>,<a href="http://wange.im/tag/slide/" title="轮播图" rel="tag">轮播图</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/marquee-scroll.html" rel="bookmark" title="基于 jQuery 的图片/文字无缝滚动">基于 jQuery 的图片/文字无缝滚动</a>        <div class="rl_date">2011年12月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-slide-loaded-on-demand.html" rel="bookmark" title="jQuery 按需加载轮播图">jQuery 按需加载轮播图</a>        <div class="rl_date">2011年09月26日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-js-ajax-pic.html" rel="bookmark" title="jQuery/JavaScript 实现的异步加载图片">jQuery/JavaScript 实现的异步加载图片</a>        <div class="rl_date">2011年04月10日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/fadeto-effect-with-jquery.html" rel="bookmark" title="利用 JQuery 实现图片显隐特效">利用 JQuery 实现图片显隐特效</a>        <div class="rl_date">2010年04月8日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/jquery-highslide-on-demand.html/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>jQuery 按需加载轮播图</title>
		<link>http://wange.im/jquery-slide-loaded-on-demand.html</link>
		<comments>http://wange.im/jquery-slide-loaded-on-demand.html#comments</comments>
		<pubDate>Mon, 26 Sep 2011 12:47:02 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[轮播图]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5126</guid>
		<description><![CDATA[引言 关于幻灯轮播图，想必大家都不陌生，尤其是基于 jQuery 的，插件、代码网上一搜一大堆，但是真正符合自己需求的几乎没有，所以我要打造一个符合自身需求，经得起广大网民考验的 jQuery 轮播图！ 思路 为什么说网上其他一些轮播图不符合我的要求？我的需求又是什么呢？ 现在网上可以找到的多数幻灯轮播图的 jQuery 插件的作法是，先把图片和链接的 HTML 写好，然后控制隐藏和显示来轮流展示当前的幻灯图片。但是对用户而言，我们始终只是看到当前的一张图片，那其他几张隐藏的图片为什么要事先加载进来呢？这不是费时费力吗？所以我的第一个需求是按需加载。 我们一般会把轮播图放在首页展示，但是首页的重点内容应该是最近更新的文章，至少我不认为图片展示功能需要被搜索引擎收录，所以我的第二个需求是符合  SEO。 实现 冲着以上两个需求，我做了一个 DEMO，这个 DEMO 和我现在的首页看起来效果基本一致，但实现的方法却天差地别。大家不妨看看这个 DEMO 的源代码，发现区别了吗？是的，在这个 DEMO 的 HTML 源代码中，你看不到任何的图片和相关信息，都由 JS 载入进来的，也就是说爬虫爬不到，而且是随着图片的切换，一张一张地载入当前的幻灯图片。 这里我就只分享一下我的 JS 写法，HTML 什么就请各位看源码吧，代码我就不一一细说了，注释也都写得很明白了。 $(function() { &#160;&#160;&#160; var WangeSlide = (function() { &#160;&#160;&#160;&#160;&#160;&#160;&#160; //配置 &#160;&#160;&#160;&#160;&#160;&#160;&#160; var config = { &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //轮播图尺寸 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width : 560, &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height [...]]]></description>
			<content:encoded><![CDATA[<p><strong>引言</strong></p>
<p>关于幻灯轮播图，想必大家都不陌生，尤其是基于 jQuery 的，插件、代码网上一搜一大堆，但是真正符合自己需求的几乎没有，所以我要打造一个符合自身需求，经得起广大网民考验的 jQuery 轮播图！</p>
<p><strong>思路</strong></p>
<p>为什么说网上其他一些轮播图不符合我的要求？我的需求又是什么呢？</p>
<p>现在网上可以找到的多数幻灯轮播图的 jQuery 插件的作法是，先把图片和链接的 HTML 写好，然后控制隐藏和显示来轮流展示当前的幻灯图片。但是对用户而言，我们始终只是看到当前的一张图片，那其他几张隐藏的图片为什么要事先加载进来呢？这不是费时费力吗？所以我的第一个需求是<strong>按需加载</strong>。</p>
<p>我们一般会把轮播图放在首页展示，但是首页的重点内容应该是最近更新的文章，至少我不认为图片展示功能需要被搜索引擎收录，所以我的第二个需求是<strong>符合  SEO</strong>。</p>
<p><strong>实现</strong></p>
<p>冲着以上两个需求，我做了一个 <a title="jQuery 按需加载轮播图" href="http://wange.im/demo/slide-on-demand/">DEMO</a>，这个 DEMO 和我现在的首页看起来效果基本一致，但实现的方法却天差地别。大家不妨看看这个 <a title="jQuery 按需加载轮播图" href="http://wange.im/demo/slide-on-demand/">DEMO</a> 的源代码，发现区别了吗？是的，在这个 DEMO 的 HTML 源代码中，你看不到任何的图片和相关信息，都由 JS 载入进来的，也就是说爬虫爬不到，而且是随着图片的切换，一张一张地载入当前的幻灯图片。</p>
<p>这里我就只分享一下我的 JS 写法，HTML 什么就请各位看源码吧，代码我就不一一细说了，注释也都写得很明白了。</p>
<div style='color: rgb(0, 0, 0); font-family: "Courier New","Consolas","Lucida Console"; background-color: rgb(255, 255, 255);' class="source"> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">WangeSlide</span> <span style="color: rgb(0, 0, 0);">=</span> (<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//配置</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">config</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//轮播图尺寸</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">width</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">560</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">height</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">250</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//是否自动切换</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">autoSwitch</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//自动切换间隔时间（毫秒）</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">interval</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">6000</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//轮播图图片路径</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">picPath</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 255);">&#39;http://wange.im/wp-content/themes/wange/images/slides/&#39;</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//轮播图图片信息：图片文件名 / 图片标题 / 图片指向链接</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">picInfo</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">[</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 255);">&#39;1.jpg&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;全套服务，求包养！&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;http://wange.im/qiu-bao-yang.html&#39;</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 255);">&#39;2.jpg&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;2012年的冬天还会冷吗？&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;http://wange.im/winter-in-2012.html&#39;</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 255);">&#39;3.jpg&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;Wordpress 免插件版侧边栏读者墙&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;http://wange.im/readerwall-on-sidebar-without-plugins.html&#39;</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 255);">&#39;4.jpg&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;Wordpress 免插件实现运行代码框&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;http://wange.im/run-code-in-wordpress-without-plugins.html&#39;</span><span style="color: rgb(0, 0, 0);">]</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">]</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">};</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//获取图片信息</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">/**</span><br /> <span style="color: rgb(0, 136, 0); font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * @param index 图片所在的索引值</span><br /> <span style="color: rgb(0, 136, 0); font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **/</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">getImgInfo</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>(<span style="color: rgb(0, 0, 0);">index</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">imgSrc</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picPath</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picInfo</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">][</span><span style="color: rgb(0, 0, 255);">0</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picInfo</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">][</span><span style="color: rgb(0, 0, 255);">1</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgUrl</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picInfo</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">][</span><span style="color: rgb(0, 0, 255);">2</span><span style="color: rgb(0, 0, 0);">],</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgId</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;slide_&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> (<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">1</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">toString</span><span style="color: rgb(0, 0, 0);">(),</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgHtml</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;li id=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgId</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot;&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;&nbsp;&nbsp;&nbsp; &lt;a href=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgUrl</span> <span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">&#39;&quot; title=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot; target=&quot;_blank" rel="nofollow" class="pic"&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgSrc</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot; alt=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot; class=&quot;slide_thumb" /&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;&nbsp;&nbsp;&nbsp; &lt;/a&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;&lt;/li&gt;&#39;</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">slideTextHtml</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;a href=&quot;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgUrl</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot; target=&quot;_blank" title="&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&quot; rel=&quot;nofollow"&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;/a&gt;&#39;</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">return</span> <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgAlt</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">imgAlt</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgUrl</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">imgUrl</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgHtml</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">imgHtml</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">slideTextHtml</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">slideTextHtml</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">};</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//图片完全加载后缓慢加载显示</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">fadeInImg</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>(<span style="color: rgb(0, 0, 0);">el</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">speed</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">el</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">load</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">this</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">fadeIn</span>(<span style="color: rgb(0, 0, 0);">speed</span>)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">});</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">};</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//图片切换</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">/**</span><br /> <span style="color: rgb(0, 136, 0); font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * @param index 图片所在的索引值</span><br /> <span style="color: rgb(0, 136, 0); font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * @param triggerCurEl 当前触发节点元素</span><br /> <span style="color: rgb(0, 136, 0); font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **/</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">imgSwitch</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>(<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">triggerCurEl</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">slideId</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;slide_&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> (<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">1</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">toString</span><span style="color: rgb(0, 0, 0);">(),</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">slideIdEl</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">document</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">getElementById</span>(<span style="color: rgb(0, 0, 0);">slideId</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">slideIdEl</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//如果已有对应的元素，则显示已有元素</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">panelLi</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#panel ul li&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">panelLi</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">fadeOut</span>(<span style="color: rgb(0, 0, 255);">&#39;slow&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 0);">slideIdEl</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">fadeIn</span>(<span style="color: rgb(0, 0, 255);">&#39;slow&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">else</span> <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//如果还没有对应的元素，则注入元素</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 0);">getImgInfo</span>(<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">imgHtml</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">appendTo</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#panel ul&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span>));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//载入显示图片</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">fadeInImg</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.slide_thumb&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">slideIdEl</span><span style="color: rgb(0, 0, 0);">),</span> <span style="color: rgb(0, 0, 255);">&#39;slow&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//获取图片的 alt 作为显示信息</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#slide_text&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">html</span>(<span style="color: rgb(0, 0, 0);">getImgInfo</span>(<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">slideTextHtml</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//当前状态 cur</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#trigger ul li&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">removeClass</span>(<span style="color: rgb(0, 0, 255);">&#39;cur&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">triggerCurEl</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">addClass</span>(<span style="color: rgb(0, 0, 255);">&#39;cur&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">};</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//轮播图</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">slide</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//设置轮播图尺寸</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">css</span><span style="color: rgb(0, 0, 0);">({</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;width&#39;</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">width</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;px&#39;</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">&#39;height&#39;</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">height</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;px&#39;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">});</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//初使化轮播图，只加载第一张图片信息</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#panel ul&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">html</span>(<span style="color: rgb(0, 0, 0);">getImgInfo</span>(<span style="color: rgb(0, 0, 255);">0</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">imgHtml</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//载入显示图片</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">fadeInImg</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.slide_thumb&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide_1&#39;</span><span style="color: rgb(0, 0, 0);">),</span> <span style="color: rgb(0, 0, 255);">500</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//注入背景层 + 触发器容器 + 轮播图文字容器</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">slideBg</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;div id=&quot;slide_bg&quot;&gt;&lt;/div&gt;&#39;</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">trigger</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;div id=&quot;trigger&quot;&gt;&lt;/div&gt;&#39;</span><span style="color: rgb(0, 0, 0);">,</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">slideText</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;div id=&quot;slide_text&quot;&gt;&lt;/div&gt;&#39;</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#panel&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">after</span>(<span style="color: rgb(0, 0, 0);">slideBg</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">trigger</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">slideText</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//获取图片的 alt 作为显示信息</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#slide_text&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">html</span>(<span style="color: rgb(0, 0, 0);">getImgInfo</span>(<span style="color: rgb(0, 0, 255);">0</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">slideTextHtml</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//注入触发节点</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">triggerUl</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;&lt;ul&gt;&lt;/ul&gt;&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">triggerUl</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">appendTo</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#trigger&#39;</span>));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">for</span> (<span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">0</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picInfo</span>; <span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">length</span>; <span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">++</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;&lt;li&gt;&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> (<span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">1</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">toString</span>() <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;&lt;/li&gt;&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">appendTo</span>(<span style="color: rgb(0, 0, 0);">triggerUl</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//当前状态 cur</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#trigger ul li:first&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">addClass</span>(<span style="color: rgb(0, 0, 255);">&#39;cur&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//点击触发节点</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">triggerLi</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#trigger ul li&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">triggerLi</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">click</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">index</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">triggerLi</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">index</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">this</span>));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgSwitch</span>(<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">this</span>));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">});</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//鼠标悬停时，停止切换</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">goSwitch</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#slide&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">hover</span>(<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><span style="color: rgb(0, 0, 0);">goSwitch</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">false</span><span style="color: rgb(0, 0, 0);">},</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><span style="color: rgb(0, 0, 0);">goSwitch</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">true</span><span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//自动切换</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">autoSwitch</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">setInterval</span>(<span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">goSwitch</span>) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//判断当前cur所在的索引值</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 0);">index</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">parseInt</span>(<span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;.cur&#39;</span><span style="color: rgb(0, 0, 0);">,</span> <span style="color: rgb(0, 0, 255);">&#39;#trigger&#39;</span><span style="color: rgb(0, 0, 0);">).</span><span style="color: rgb(0, 0, 0);">text</span>()) <span style="color: rgb(0, 0, 0);">-</span> <span style="color: rgb(0, 0, 255);">1</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">if</span> (<span style="color: rgb(0, 0, 0);">index</span> <span style="color: rgb(0, 0, 0);">&gt;</span> (<span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">picInfo</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">length</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 255);">2</span>)) <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">index</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 255);">1</span>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">imgSwitch</span>((<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">1</span><span style="color: rgb(0, 0, 0);">),</span> <span style="color: rgb(0, 0, 0);">$</span>(<span style="color: rgb(0, 0, 255);">&#39;#trigger ul li:eq(&#39;</span> <span style="color: rgb(0, 0, 0);">+</span> (<span style="color: rgb(0, 0, 0);">index</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 255);">1</span>) <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 255);">&#39;)&#39;</span>));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">},</span> <span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">interval</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">};</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 128); font-weight: bold;">return</span> <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 136, 0); font-style: italic;">//初使化</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">init</span> <span style="color: rgb(0, 0, 0);">:</span> <span style="color: rgb(0, 0, 128); font-weight: bold;">function</span>() <span style="color: rgb(0, 0, 0);">{</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">slide</span>();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">}</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">})();</span><br /> &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 0);">WangeSlide</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 0);">init</span>();<br /> <span style="color: rgb(0, 0, 0);">})</span></div>
<p><strong>优势</strong></p>
<p>同样的效果，只是实现方法不同？会不会很蛋疼？这有什么优势呢？</p>
<p>举个例子来说，优化前，假设首页切换的幻灯图片有5张，平均每张图片20K，也就是说你的首页至少要加载100K的图片，而这100K的图片你能保证每个用户都会去看吗？如果用户不看，岂不是白白浪费了这100K的载入速度？</p>
<p>优化后，在首页初次载入的时候，仅需加载一张1K左右的，甚至是可有可无的 loading 图片，当用户点击下一张或者达到定时器的设置时才会去加载下一张图片，大大节省了载入的时间。1K？100K？你懂的。</p>
<p>另外，用 JS 载入所需的图片还有一个好处，就是在一些不支持 JS 的手机浏览器上，载入 100K 的图片对于无法切换的轮播图而言，是一个极大的累赘，而且也会大大降低用户体验。</p>
<p>好了，大家各取所需吧，我也只是提供了一个思路，如果有更好的实现方法欢迎与我交流。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/jquery/" title="jQuery" rel="tag">jQuery</a>,<a href="http://wange.im/tag/slide/" title="轮播图" rel="tag">轮播图</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-highslide-on-demand.html" rel="bookmark" title="jQuery 按需加载 HighSlide 效果">jQuery 按需加载 HighSlide 效果</a>        <div class="rl_date">2011年10月10日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/marquee-scroll.html" rel="bookmark" title="基于 jQuery 的图片/文字无缝滚动">基于 jQuery 的图片/文字无缝滚动</a>        <div class="rl_date">2011年12月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/ajax-get-in-jquery.html" rel="bookmark" title="用 jQuery 实现异步跨域请求">用 jQuery 实现异步跨域请求</a>        <div class="rl_date">2011年09月6日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-dialog-layer.html" rel="bookmark" title="jQuery 精简版弹出对话框层">jQuery 精简版弹出对话框层</a>        <div class="rl_date">2011年05月11日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/jquery-slide-loaded-on-demand.html/feed</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>用 jQuery 实现异步跨域请求</title>
		<link>http://wange.im/ajax-get-in-jquery.html</link>
		<comments>http://wange.im/ajax-get-in-jquery.html#comments</comments>
		<pubDate>Tue, 06 Sep 2011 15:36:52 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5091</guid>
		<description><![CDATA[最近在项目中有这样一个需求，需要异步跨域发送请求，而且是要跨大域，也就是在 a.com 请求 b.com 上的数据，我还从来没有用 YUI 去处理过这样一个异步跨域的请求，询问了做过同类需求的同事，才知道可以用 YUI 的 YAHOO.util.Get.script 方法，用 JSONP 格式来调用跨域的数据，而且兼容所有浏览器。 这个思路很不错，但是用 YUI 的童鞋毕竟是少数，我想 jQuery 应该也有类似的方法来处理异步跨域请求，果然，让我找到了 jQuery 的 getScript 方法，和 YUI 的 YAHOO.util.Get.script  有异曲同工之妙。就做了一个简单的 DEMO。 首先，先定义好最终要调用的数据格式： window.demo = { "txt" : "Hello World" } 这就是所谓的 JSONP，把数据以 JSON 的格式保存在一个对象中，方便我们之后去引用这个对象。 然后，我们就可以用 getScript 的方法去异步加载刚才保存的 JS，并处理返回结果，方法如下： var url = 'http://hnxl2a.bay.livefilestore.com/y1ppSRzo-oh5zvQRz1vRRA7DycnwtWX5Lch33sFAaHAJz3a3EC3QuZQJ0wb88oPhxRdUTRrM4JwFCRtlyqzyjMP7w/demo.js'; var success = function() { alert(window.demo.txt) }; [...]]]></description>
			<content:encoded><![CDATA[<p>最近在项目中有这样一个需求，需要异步跨域发送请求，而且是要跨大域，也就是在 a.com 请求 b.com 上的数据，我还从来没有用 YUI 去处理过这样一个异步跨域的请求，询问了做过同类需求的同事，才知道可以用 YUI 的 YAHOO.util.Get.script 方法，用 JSONP 格式来调用跨域的数据，而且兼容所有浏览器。</p>
<p>这个思路很不错，但是用 YUI 的童鞋毕竟是少数，我想 jQuery 应该也有类似的方法来处理异步跨域请求，果然，让我找到了 jQuery 的 getScript 方法，和 YUI 的 YAHOO.util.Get.script  有异曲同工之妙。就做了一个简单的 DEMO。</p>
<p>首先，先定义好最终要调用的数据格式：</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">demo</span> <span style="color: #000000;">=</span> <span style="color: #000000;">{</span><br />
<span style="color: #0000ff;">"txt"</span> <span style="color: #000000;">:</span> <span style="color: #0000ff;">"Hello World"</span><br />
<span style="color: #000000;">}</span></div>
<p>这就是所谓的 JSONP，把数据以 JSON 的格式保存在一个对象中，方便我们之后去引用这个对象。</p>
<p>然后，我们就可以用 getScript 的方法去异步加载刚才保存的 JS，并处理返回结果，方法如下：</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">url</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">'http://hnxl2a.bay.livefilestore.com/y1ppSRzo-oh5zvQRz1vRRA7DycnwtWX5Lch33sFAaHAJz3a3EC3QuZQJ0wb88oPhxRdUTRrM4JwFCRtlyqzyjMP7w/demo.js'</span>;<br />
<span style="color: #000080; font-weight: bold;">var</span> <span style="color: #000000;">success</span> <span style="color: #000000;">=</span> <span style="color: #000080; font-weight: bold;">function</span>() <span style="color: #000000;">{</span><br />
<span style="color: #000000;">alert</span>(<span style="color: #000000;">window</span><span style="color: #000000;">.</span><span style="color: #000000;">demo</span><span style="color: #000000;">.</span><span style="color: #000000;">txt</span>)<br />
<span style="color: #000000;">};</span><br />
<span style="color: #000000;">$</span><span style="color: #000000;">.</span><span style="color: #000000;">getScript</span>(<span style="color: #000000;">url</span><span style="color: #000000;">,</span> <span style="color: #000000;">success</span>);</div>
<p>保存以上两个文件，在本地运行就能看到效果，当然，不要忘记加载 jQuery。</p>
<p>后记：</p>
<p>1、写习惯了原生的 JS，难得记录一下 jQuery，还真有点不习惯。</p>
<p>2、已经有童鞋再三催促我更新，再不写些东西，自己都觉得不好意思。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/ajax/" title="AJAX" rel="tag">AJAX</a>,<a href="http://wange.im/tag/jquery/" title="jQuery" rel="tag">jQuery</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-js-ajax-pic.html" rel="bookmark" title="jQuery/JavaScript 实现的异步加载图片">jQuery/JavaScript 实现的异步加载图片</a>        <div class="rl_date">2011年04月10日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/html5-innershiv-translated-doc.html" rel="bookmark" title="HTML5 innerShiv 翻译文档">HTML5 innerShiv 翻译文档</a>        <div class="rl_date">2011年03月11日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/marquee-scroll.html" rel="bookmark" title="基于 jQuery 的图片/文字无缝滚动">基于 jQuery 的图片/文字无缝滚动</a>        <div class="rl_date">2011年12月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/jquery-highslide-on-demand.html" rel="bookmark" title="jQuery 按需加载 HighSlide 效果">jQuery 按需加载 HighSlide 效果</a>        <div class="rl_date">2011年10月10日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/ajax-get-in-jquery.html/feed</wfw:commentRss>
		<slash:comments>83</slash:comments>
		</item>
		<item>
		<title>WordPress 正文批量替换的两种方法</title>
		<link>http://wange.im/str-replace-in-wordpress.html</link>
		<comments>http://wange.im/str-replace-in-wordpress.html#comments</comments>
		<pubDate>Thu, 28 Jul 2011 15:10:33 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[Discuz]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5039</guid>
		<description><![CDATA[最近一直都比较忙，所以也没有时间接各种各样的需求，WordPress 折腾得也少了，现在 WordPress 都已经升级到 3.2.1 了，那些最新的功能啊、函数啊都还没有玩过，有点脱节，只能拿一些小问题但比较实用的方法出来分享给大家。 今天有一个朋友问了我一个关于 WordPress 的问题，需求的背景是这样的，在他的博客文章里曾经插入了很多指向到 Discuz 论坛的链接，然而，自从那个 Discuz 论坛升级到 X2 以后，链接地址都改变了，导致之前在 WordPress 中插入的论坛链接都失效了。面对这样的问题，我认为有两种解决方案，一是从 Discuz 论坛下手，做 301 重定向，把旧的链接引向新地址；二是从 WordPress 下手，批量修改文中已经存在的链接地址。 当然，我在这里选择从 WordPress 下手，从 WordPress 下手也可以有两种方法。一是从数据库下手，二是从 WordPress 主题下手，我一一来介绍一下。 一、从数据库下手 在数据库里批量替换的方法以前有介绍过，这里再重温一下，进入 phpmyadmin，找到你的数据表，先备份，然后运行 SQL，输入以下语句即可： UPDATE wp_posts SET post_content = replace(post_content, 'old', 'new'); 其中 old 是旧的字符串，new 是你要替换的文字。 二、从 WordPress 主题下手 在 WordPress 主题的 functions.php 中插入以下代码： function [...]]]></description>
			<content:encoded><![CDATA[<p>最近一直都比较忙，所以也没有时间接各种各样的需求，WordPress 折腾得也少了，现在 WordPress 都已经升级到 3.2.1 了，那些最新的功能啊、函数啊都还没有玩过，有点脱节，只能拿一些小问题但比较实用的方法出来分享给大家。</p>
<p>今天有一个朋友问了我一个关于 WordPress 的问题，需求的背景是这样的，在他的博客文章里曾经插入了很多指向到 Discuz 论坛的链接，然而，自从那个 Discuz 论坛升级到 X2 以后，链接地址都改变了，导致之前在 WordPress 中插入的论坛链接都失效了。面对这样的问题，我认为有两种解决方案，一是从 Discuz 论坛下手，<a title="修改 .htaccess 实现 301 重定向" href="http://wange.im/redirect-by-htaccess.html">做 301 重定向</a>，把旧的链接引向新地址；二是从 WordPress 下手，批量修改文中已经存在的链接地址。</p>
<p>当然，我在这里选择从 WordPress 下手，从 WordPress 下手也可以有两种方法。一是从数据库下手，二是从 WordPress 主题下手，我一一来介绍一下。</p>
<p><strong>一、从数据库下手</strong></p>
<p>在数据库里批量替换的方法以前<a title="更换域名后应该做的事情" href="http://wange.im/after-change-domain.html">有介绍过</a>，这里再重温一下，进入 phpmyadmin，找到你的数据表，先备份，然后运行 SQL，输入以下语句即可：</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000000;">UPDATE</span> <span style="color: #000000;">wp_posts</span> <span style="color: #000000;">SET</span> <span style="color: #000000;">post_content</span> <span style="color: #000000;">=</span> <span style="color: #000000;">replace</span>(<span style="color: #000000;">post_content</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'old'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'new'</span>);</div>
<p>其中 old 是旧的字符串，new 是你要替换的文字。</p>
<p><strong>二、从 WordPress 主题下手</strong></p>
<p>在 WordPress 主题的 functions.php 中插入以下代码：</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000080; font-weight: bold;">function</span> <span style="color: #000000;">content_str_replace</span>(<span style="color: #000000;">$content</span> <span style="color: #000000;">=</span> <span style="color: #0000ff;">''</span><span style="color: #000000;">){</span><br />
<span style="color: #000000;">$content</span> <span style="color: #000000;">=</span> <span style="color: #000000;">str_replace</span>(<span style="color: #0000ff;">'old'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'new'</span><span style="color: #000000;">,</span> <span style="color: #000000;">$content</span>);<br />
<span style="color: #000080; font-weight: bold;">return</span> <span style="color: #000000;">$content</span>;<br />
<span style="color: #000000;">}</span><br />
<span style="color: #000000;">add_filter</span>(<span style="color: #0000ff;">'the_content'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">'content_str_replace'</span><span style="color: #000000;">,</span> <span style="color: #0000ff;">10</span>);</div>
<p>和之前一样，其中 old 是旧的字符串，new 是你要替换的文字。</p>
<p>两个方法都很简单，但是各有各的特点。</p>
<p>从数据库下手的话，优点就是一劳永逸，彻底替换所有文字内容，但是对于不熟悉数据库的朋友还是不推荐冒然操作数据库，就怕一失足成千骨恨。</p>
<p>从 WordPress 下手的话，优点就是安全，再不济也就是把主题改坏了，重新上传一下就 OK，但是在性能方法就比数据库操作要差一些，因为每次浏览文章都必须在后台进行一次替换的操作。</p>
<p>所以，到底选择哪个方法，就需要看官们自己衡量了。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/discuz/" title="Discuz" rel="tag">Discuz</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/screenshot.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="新年新气象，博客换新衣" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/new-year-new-theme.html" rel="bookmark" title="新年新气象，博客换新衣">新年新气象，博客换新衣</a>        <div class="rl_date">2012年01月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/2011-12-29_194903.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="2011 年终总结" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/2011-year-end-summary.html" rel="bookmark" title="2011 年终总结">2011 年终总结</a>        <div class="rl_date">2011年12月29日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/speech.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="给 WordPress 添加语音搜索功能" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/x-webkit-speech-in-wordpress.html" rel="bookmark" title="给 WordPress 添加语音搜索功能">给 WordPress 添加语音搜索功能</a>        <div class="rl_date">2011年12月4日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/weibo_share.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="WordPress 将选中文字转发到微博" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/wordpress-share-selected-text-to-weibo.html" rel="bookmark" title="WordPress 将选中文字转发到微博">WordPress 将选中文字转发到微博</a>        <div class="rl_date">2011年10月30日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/str-replace-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>135</slash:comments>
		</item>
		<item>
		<title>优化 WordPress 博客在 iPhone 中的显示</title>
		<link>http://wange.im/optimize-wordpress-for-iphone.html</link>
		<comments>http://wange.im/optimize-wordpress-for-iphone.html#comments</comments>
		<pubDate>Wed, 20 Jul 2011 12:32:42 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wange.im/?p=5008</guid>
		<description><![CDATA[“预计在未来一两年内，移动终端上网用户将超过PC互联网。”这话不是我说的，而是出自新浪 CEO 曹国伟之口。当然，我也很认同他的观点，在无聊的上下班路上、在领导开会高谈阔论时、甚至是坐在马桶上便便的时候，移动终端设备都已经成为了替换电脑随时随地可以连接上互联网的最好工具。而如今最火最潮的移动终端设置无异于苹果系列的 iPhone、iTouch 以及 iPad，也就是说，如果你的网站可以在以上这些移动终端设备上能够提供更好的用户体验，也就有可能赢得更多的市场。 本文将以 iPhone 为例，介绍一下如何在众多移动终端设备上个性化设置你的 WordPress 博客。有 iPhone 的童鞋不妨先用 iPhone 上的浏览器 safari 来浏览一下本站，看一下和电脑上的浏览器看到的有何不同？ 哈，没错，如图所示，左右两图分别是本站首页优化前和优化后的比较。在优化之前 iPhone 上浏览本站基本上和在电脑上看到的一样，而在优化之后 iPhone 上浏览本站则可以看到一个单栏的页面。相对电脑显示器来说，手机显示屏很小，要在有限的显示范围内展现给用户最重点最需要的内容才是王道，所以我把侧边栏、轮播图、广告、顶部工具条、评论部分等那些个花里胡哨的东西给隐藏了，这是如何做到的呢？ 其实很简单，因为我们知道 iPhone 显示屏的分辨率统一是 480px，那就只需要为这一宽度的设备单独定义样式就可以了，就和普通的 CSS 引入方法类似，方法有两种： 1、为 iPhone 单独引入一个新的 CSS 文件（我就是这么干的） &#60;link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="&#60;?php bloginfo('template_directory'); ?&#62;/iphone.css" /&#62; 把这个放在 header.php 头部的 style.css 引入文件之后就可以。 2、直接在 style.css 中修改，把对 iphone 下的样式定义写在 [...]]]></description>
			<content:encoded><![CDATA[<p>“预计在未来一两年内，移动终端上网用户将超过PC互联网。”这话不是我说的，而是出自新浪 CEO 曹国伟之口。当然，我也很认同他的观点，在无聊的上下班路上、在领导开会高谈阔论时、甚至是坐在马桶上便便的时候，移动终端设备都已经成为了替换电脑随时随地可以连接上互联网的最好工具。而如今最火最潮的移动终端设置无异于苹果系列的 iPhone、iTouch 以及 iPad，也就是说，如果你的网站可以在以上这些移动终端设备上能够提供更好的用户体验，也就有可能赢得更多的市场。</p>
<p>本文将以 iPhone 为例，介绍一下如何在众多移动终端设备上个性化设置你的 WordPress 博客。有 iPhone 的童鞋不妨先用 iPhone 上的浏览器 safari 来浏览一下本站，看一下和电脑上的浏览器看到的有何不同？</p>
<p><img src="http://byfiles.storage.live.com/y1px5BDj4rDGpJPKtw5wkdd6Dg5BzRXPKOAGp5DWOSDYbH0cj2JMUgFcKMXk_ZfJUVSc14xO5hko8k/iphone1.png" /><img src="http://byfiles.storage.live.com/y1px5BDj4rDGpJv-TPmppLzRz04J7aPSnGRfEheaML9ahye8_D4BvP2TcKUUh-cL1jilTPtI0n5byo/iphone2.png" /></p>
<p>哈，没错，如图所示，左右两图分别是本站首页优化前和优化后的比较。在优化之前 iPhone 上浏览本站基本上和在电脑上看到的一样，而在优化之后 iPhone 上浏览本站则可以看到一个单栏的页面。相对电脑显示器来说，手机显示屏很小，要在有限的显示范围内展现给用户最重点最需要的内容才是王道，所以我把侧边栏、轮播图、广告、顶部工具条、评论部分等那些个花里胡哨的东西给隐藏了，这是如何做到的呢？</p>
<p>其实很简单，因为我们知道 iPhone 显示屏的分辨率统一是 480px，那就只需要为这一宽度的设备单独定义样式就可以了，就和普通的 CSS 引入方法类似，方法有两种：</p>
<p>1、为 iPhone 单独引入一个新的 CSS 文件（我就是这么干的）</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000080; font-weight: bold;">&lt;link</span> <span style="color: #ff0000;">rel=</span><span style="color: #0000ff;">"stylesheet"</span> <span style="color: #ff0000;">type=</span><span style="color: #0000ff;">"text/css"</span> <span style="color: #ff0000;">media=</span><span style="color: #0000ff;">"only screen and (max-device-width: 480px)"</span> <span style="color: #ff0000;">href=</span><span style="color: #0000ff;">"</span><span style="color: #008080;">&lt;?php</span> <span style="color: #000000;">bloginfo</span>(<span style="color: #0000ff;">'template_directory'</span>); <span style="color: #008080;">?&gt;</span><span style="color: #0000ff;">/iphone.css"</span> <span style="color: #000080; font-weight: bold;">/&gt;</span></div>
<p>把这个放在 header.php 头部的 style.css 引入文件之后就可以。</p>
<p>2、直接在 style.css 中修改，把对 iphone 下的样式定义写在 style.css 中的最后即可。</p>
<div class="source" style="color: #000000; font-family: 'Courier New','Consolas','Lucida Console';"><span style="color: #000080; font-weight: bold;">@media</span> <span style="color: #000080; font-weight: bold;">only</span> <span style="color: #000080; font-weight: bold;">screen</span> <span style="color: #000080; font-weight: bold;">and</span> (<span style="color: #000080; font-weight: bold;">max-device-width</span><span style="color: #000000;">:</span> <span style="color: #000080; font-weight: bold;">480px</span>) <span style="color: #000000;">{</span><br />
<span style="color: #000000;">.forIphone</span><span style="color: #000000;">{</span><br />
<span style="color: #008800; font-style: italic;">/* style for iPhone */</span><br />
<span style="color: #000000;">}</span><br />
<span style="color: #000000;">}</span></div>
<p>@media only screen and (max-device-width: 480px) 这种是 CSS3 的写法，所以你妄想在 iPhone 下用其他什么扣扣浏览器、UCWEB 等货去尝试，此方法只对 safari 等标准浏览器有效。</p>
<p>此方法只是一个抛砖，还有更多神奇的玩法等你去开发，比如说如何优化 WordPress 在 iPad 上的显示？当然，这个方面不只是应用在 WordPress 上，所有支持 CSS3 浏览器的用户和网站都能实现这一功能，try try 吧~</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/css3/" title="CSS3" rel="tag">CSS3</a>,<a href="http://wange.im/tag/iphone/" title="iPhone" rel="tag">iPhone</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/css.png&amp;h=45&amp;w=45&amp;zc=1" alt="CSS3 鼠标悬停图片动画效果" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/css-3-hover-animations.html" rel="bookmark" title="CSS3 鼠标悬停图片动画效果">CSS3 鼠标悬停图片动画效果</a>        <div class="rl_date">2009年09月6日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/screenshot.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="新年新气象，博客换新衣" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/new-year-new-theme.html" rel="bookmark" title="新年新气象，博客换新衣">新年新气象，博客换新衣</a>        <div class="rl_date">2012年01月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/2011-12-29_194903.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="2011 年终总结" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/2011-year-end-summary.html" rel="bookmark" title="2011 年终总结">2011 年终总结</a>        <div class="rl_date">2011年12月29日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/speech.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="给 WordPress 添加语音搜索功能" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/x-webkit-speech-in-wordpress.html" rel="bookmark" title="给 WordPress 添加语音搜索功能">给 WordPress 添加语音搜索功能</a>        <div class="rl_date">2011年12月4日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/optimize-wordpress-for-iphone.html/feed</wfw:commentRss>
		<slash:comments>176</slash:comments>
		</item>
		<item>
		<title>衣服脱脱脱，越脱越精彩</title>
		<link>http://wange.im/ifttt.html</link>
		<comments>http://wange.im/ifttt.html#comments</comments>
		<pubDate>Sun, 03 Jul 2011 12:35:22 +0000</pubDate>
		<dc:creator>万戈</dc:creator>
				<category><![CDATA[电脑网络]]></category>
		<category><![CDATA[ifttt]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://wange.im/?p=4978</guid>
		<description><![CDATA[很庆幸活在当下，可以目睹互联网一天一个样，三天大变样的神迹。最近忙于搬家，没有太过关注互联网近期的热门事件，今天有点时间坐下来刷几天以来积累的 Google Reader，才发现原来我已经错过了很多热点，比如说 Google 推出的对付 Facebook 的重磅武器 Google+，还有那个有着 YD 中文名的 ifttt （衣服脱脱脱）。 今天的猪脚的就是“衣服脱脱脱”，首先要感谢一下三思童鞋，给了我一个 ifttt 的邀请码，同时也要感谢其他积极响应给我邀请码的小盆友。可能现在再来谈 ifttt 已经没有那么多新鲜感了，不过我还是想从我试用的体验角度来评价一下 ifttt。 先科普一下，神马是 ifttt。ifttt，就是 If This Then That 的缩写。从逻辑角度来说，很好理解，就是当达到某个你设定的条件后，就触发另一个你所设定的条件。而你可以设定的条件是一些你耳熟能详的互联网服务，比如说 WordPress、Twitter、YouTube、Facebook、Gtalk、Google Reader 等34个服务。而每个用户最多可以设定10个事件。 在如今满网络都是 SNS 和类似于微博客这样的聚合服务的大环境下，突然杀出这么一个 ifttt，的确让人耳目一新，不得不佩服这个项目的创意。与此同时，我也为它在国内发展的生命力而感到担忧，每个人都可以预想到，在不久的将来，我们将看到一个构思、功能、甚至设计都如出一辙的产品 Made in China，然后 ifttt 就被各种名义（或许都不需要任何理由）隔离于墙外。然而，这样的服务 Made in China 又有什么意义呢？我们知道 Twitter、YouTube、Facebook 等这些服务正是因为开放 API，真正让互联网互通自由发展而变得强大，国内这些服务商做的到吗？显然不行。 抱怨无益，在衣服脱脱脱被墙暴之前，我们还是好好享受这脱的快乐吧。这里提醒一下 Google Apps 的用户吧，在 ifttt 绑定 Gtalk 的时候，需要加 ifttt@bot.im 为好友来获取验证码，但是 Google [...]]]></description>
			<content:encoded><![CDATA[<p>很庆幸活在当下，可以目睹互联网一天一个样，三天大变样的神迹。最近忙于搬家，没有太过关注互联网近期的热门事件，今天有点时间坐下来刷几天以来积累的 Google Reader，才发现原来我已经错过了很多热点，比如说 Google 推出的对付 Facebook 的重磅武器 Google+，还有那个有着 YD 中文名的 <a title="ifttt" href="http://ifttt.com/" rel="external nofollow" target="_blank">ifttt</a> （衣服脱脱脱）。</p>
<p>今天的猪脚的就是“衣服脱脱脱”，首先要感谢一下<a title="三思" href="http://t.qq.com/sunthink" rel="external nofollow" target="_blank">三思</a>童鞋，给了我一个 ifttt 的邀请码，同时也要感谢其他积极响应给我邀请码的小盆友。可能现在再来谈 ifttt 已经没有那么多新鲜感了，不过我还是想从我试用的体验角度来评价一下 ifttt。</p>
<p>先科普一下，神马是 <strong>ifttt</strong>。<abbr title="If This Then That">ifttt</abbr>，就是 If This Then That 的缩写。从逻辑角度来说，很好理解，就是当达到某个你设定的条件后，就触发另一个你所设定的条件。而你可以设定的条件是一些你耳熟能详的互联网服务，比如说 WordPress、Twitter、YouTube、Facebook、Gtalk、Google Reader 等34个服务。而每个用户最多可以设定10个事件。</p>
<p>在如今满网络都是 SNS 和类似于微博客这样的聚合服务的大环境下，突然杀出这么一个 ifttt，的确让人耳目一新，不得不佩服这个项目的创意。与此同时，我也为它在国内发展的生命力而感到担忧，每个人都可以预想到，在不久的将来，我们将看到一个构思、功能、甚至设计都如出一辙的产品 Made in China，然后 ifttt 就被各种名义（或许都不需要任何理由）隔离于墙外。然而，这样的服务 Made in China 又有什么意义呢？我们知道 Twitter、YouTube、Facebook 等这些服务正是因为开放 API，真正让互联网互通自由发展而变得强大，国内这些服务商做的到吗？显然不行。</p>
<p><img style="float: right;" src="http://byfiles.storage.live.com/y1p7YOsOwUY7Iu_vz-GguDsHQ-ATw12T1eUPsZ2ZZAkblKA1EfD9F_gP7j0RAM4_xs7xUL6OytkfksgJZkE9oXG2w/ifttt.jpg" alt="" />抱怨无益，在<strong>衣服脱脱脱</strong>被墙暴之前，我们还是好好享受这脱的快乐吧。这里提醒一下 Google Apps 的用户吧，在 ifttt 绑定 Gtalk 的时候，需要加 ifttt@bot.im 为好友来获取验证码，但是 Google Apps 的用户与该服务的提供商的通讯是受限的，不过没有关系，<a title="启用在 Google Apps 外聊天" href="http://www.google.com/support/a/bin/answer.py?hl=zh-cn&amp;answer=34143" rel="external nofollow" target="_blank">Google 给出了官方的解决方案</a>。</p>
<p>我暂时在 ifttt 上设置了两个 task，一个是发布 WordPress 日志，则同步到 <a title="@wange1228" href="http://www.facebook.com/wange1228" target="_blank">Facebook</a> 的状态，另一个是发布 WordPress 日志，则发送短信通知。到底好不好用，我也没测试过，就看这篇文章发布后的结果了。</p>
<p>PS1：谁是冲着本文标题P颠P颠来看的，自觉点，面壁去吧，哈哈。</p>
<p>PS2：我这里有三个 itfff 的邀请码，想要的举手（已经发完鸟）。</p>
<div id="rl_posts">    <div id="rl_posts_hd" class="box_hd">        <span id="rl_posts_title" class="box_title">与 <h2 itemprop="keywords"><a href="http://wange.im/tag/ifttt/" title="ifttt" rel="tag">ifttt</a>,<a href="http://wange.im/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>,<a href="http://wange.im/tag/network/" title="网络" rel="tag">网络</a></h2> 相关的文章        </span>    </div>    <div id="rl_posts_bd">        <ul class="clearfix"><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/screenshot.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="新年新气象，博客换新衣" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/new-year-new-theme.html" rel="bookmark" title="新年新气象，博客换新衣">新年新气象，博客换新衣</a>        <div class="rl_date">2012年01月20日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/imgs/category/computer.jpg" alt="电脑网络" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/no-internet-in-spring-festival.html" rel="bookmark" title="今年过节不上网！">今年过节不上网！</a>        <div class="rl_date">2012年01月17日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/2011-12-29_194903.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="2011 年终总结" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/2011-year-end-summary.html" rel="bookmark" title="2011 年终总结">2011 年终总结</a>        <div class="rl_date">2011年12月29日</div>    </div></li><li>    <div class="rl_thumb"><img src="http://wange.im/wp-content/themes/wange/timthumb.php?src=http://wange.im/cache/speech.jpg&amp;h=45&amp;w=45&amp;zc=1" alt="给 WordPress 添加语音搜索功能" width="45" height="45" itemprop="thumbnailUrl" />    </div>    <div class="rl_title">        <a href="http://wange.im/x-webkit-speech-in-wordpress.html" rel="bookmark" title="给 WordPress 添加语音搜索功能">给 WordPress 添加语音搜索功能</a>        <div class="rl_date">2011年12月4日</div>    </div></li>        </ul>    </div></div>]]></content:encoded>
			<wfw:commentRss>http://wange.im/ifttt.html/feed</wfw:commentRss>
		<slash:comments>204</slash:comments>
		</item>
	</channel>
</rss>

