<?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>I&#039;m qiqiboy !</title>
	<atom:link href="http://www.qiqiboy.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.qiqiboy.com</link>
	<description>一个very朝气的小孩子...</description>
	<lastBuildDate>Wed, 29 May 2013 15:53:37 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>如何快速为wordpress网站开发对外的数据接口</title>
		<link>http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html</link>
		<comments>http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comments</comments>
		<pubDate>Wed, 29 May 2013 12:00:00 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress技巧]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[接口]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2912</guid>
		<description><![CDATA[随着移动互联网的发展，越来越的传统站点都在为移动化做努力，如开发一套手机专用的网站主题，甚至专门为其开发app！但是开发app（非嵌入移动版网页的PhoneGap），就会涉及到接口调用！如何才能在不影响网站原来内容、模板的情况下快速开发出可供第三方调用的数据接口呢？]]></description>
				<content:encoded><![CDATA[<blockquote><p>随着移动互联网的发展，越来越的传统站点都在为移动化做努力，如开发一套手机专用的网站主题，甚至专门为其开发app！但是开发app（非嵌入移动版网页的PhoneGap），就会涉及到接口调用！如何才能在不影响网站原来内容、模板的情况下快速开发出可供第三方调用的数据接口呢？</p></blockquote>
<p>也许有同学会说，wordpress具有强大的主题切换能力，通过一个简单的主题预览插件就可以实现不同主题显示不同的内容，接口就在另一个主题下实现！</p>
<p>没错，这种方式确实可以，但是由于wordpress目前cms功能越来越强大，很多网站都使用了自定义模板、register_post_type、register_nav_menus等功能，wordpress的主题切换不能很好的兼容这些地方（即使register_post_type代码照搬）。即使克服了以上的困难，如果以后网站增加版块或者新功能，要维护就得同时改动网站主题和api主题模板，工作量巨大。</p>
<h3>那么有没有什么简单的方法呢？</h3>
<p>当然有，不然我在这里罗里吧嗦开头那些屁话干啥！我的这个方法可以在原有的主题基础上进行方便的接口开发。</p>
<p>如何做呢？</p>
<p>首先在网站所用主题的functions.php文件中增加以下代码：</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> <span style="color: #0000ff;">if</span>(isset($_GET[<span style="color: #006080;">'json'</span>])){</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span>    add_filter(<span style="color: #006080;">'template_include'</span>,<span style="color: #006080;">'wp_my_api'</span>);</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;">   3:</span> }</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;">   4:</span> function wp_my_api($template){</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;">   5:</span>     <span style="color: #0000ff;">return</span> preg_replace(<span style="color: #006080;">'#([^/]+\.php)#'</span>,<span style="color: #006080;">'api/$1'</span>,$template);</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;">   6:</span> }</pre>

</div>
</div>
<p>然后在网站当前所用主题目录下新建一个文件夹，名字为“api”。然后把主题下的模板文件复制进api文件夹里，就可以对这些模板进行接口数据转化了。比如输出json或者xml等。</p>
<p>这种方法原理就是将wordpress的模板重新定义到api文件下寻找同名模板文件。如果你愿意做更多的探寻，还可以实现更加智能的接口模板匹配功能出来。我这里就展示了最简单的方法。</p>
<p>这种方法完全不影响网站原有的模板文件，不需要改动任何原有模板，接口的实现在api文件夹下的同名文件里实现。</p>
<h3>使用示例</h3>
<p>要将你的主题下的page.php模板进行json化输出，只需要在api文件下新建一个叫page.php的模板（或者复制page.php过来），里面写入：</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> &lt;?php <span style="color: #008000;">//这里偷懒了，直接将wordpress的$wp_query对象json化输出，实际中最好提取自己需要的内容输出，以减少http传输量</span></pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span> header(<span style="color: #006080;">"Content-type:application/json"</span>);</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;">   3:</span> <span style="color: #0000ff;">if</span>(<span style="color: #0000ff;">isset</span>($_GET[<span style="color: #006080;">'debug'</span>])){</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;">   4:</span>     print_r($wp_query);</pre>

<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;">   5:</span> }<span style="color: #0000ff;">else</span> <span style="color: #0000ff;">echo</span> json_encode($wp_query);</pre>

</div>
</div>
<p>比如网站有个页面，地址是<a href="http://yoursite.com/pagename">http://yoursite.com/pagename</a>，其对应的接口地址就是<a href="http://yoursite.com/pagename?json">http://yoursite.com/pagename?json</a>。如果要调试，查看json接口，可以加上debug参数，如<a href="http://yoursite.com/pagename?json&amp;debug">http://yoursite.com/pagename?json&amp;debug</a>。</p>
<p>是不是很简单呢？如果你的网站不需要这个接口了，只需要直接删除api文件夹就行了。</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/09/rrr.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 搜索自定义字段(模糊查询)" class="thumb" /><a href="http://www.qiqiboy.com/2011/09/14/query-posts-by-postmeta.html" title="wordpress 搜索自定义字段(模糊查询)">wordpress 搜索自定义字段(模糊查询)</a> (21)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/08/demo.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 按首字母排列文章/检索文章" class="thumb" /><a href="http://www.qiqiboy.com/2011/08/10/wordpress-search-post-by-first-char.html" title="wordpress 按首字母排列文章/检索文章">wordpress 按首字母排列文章/检索文章</a> (19)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/06/5.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress的微博时间显示方法" class="thumb" /><a href="http://www.qiqiboy.com/2011/06/10/sina-weibo-timestamp-function-2.html" title="wordpress的微博时间显示方法">wordpress的微博时间显示方法</a> (20)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/1d7a79196621_DAE1/434.png&amp;h=100&amp;w=100&amp;zc=1" alt="仿腾讯微博式访客信息悬浮显示（JavaScript &amp; ajax）" class="thumb" /><a href="http://www.qiqiboy.com/2010/08/16/visitor-information-tencent-suspended-micro-display.html" title="仿腾讯微博式访客信息悬浮显示（JavaScript &amp; ajax）">仿腾讯微博式访客信息悬浮显示（JavaScript &amp; ajax）</a> (115)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/renren.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress开发 - 仿淫淫网新鲜事评论的评论列表实现" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/13/wordpress-comemnts-like-renren.html" title="wordpress开发 &#8211; 仿淫淫网新鲜事评论的评论列表实现">wordpress开发 &#8211; 仿淫淫网新鲜事评论的评论列表实现</a> (49)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fv">http://qiqi.boy.im/fv<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2013年06月18日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-29127">新葡京</a> say: 这篇文章首页调用的图片太邪恶了。。话说评论这个样式真给力啊。。。有点明信片的意思。</li><li>2013年06月8日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-28046">zwwooooo</a> say: 好像很方便的样子，再写写具体应用方案吧，哈。</li><li>2013年06月8日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-28013">一堵墙</a> say: 感觉好高 的说</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-27599">mopvhs</a> say: <a href="#comment-27586" rel="nofollow">@liuqiqi </a> 
= = 坐大腿~~</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-27588">soping</a> say: 虽不明，但觉厉！</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-27587">key4ever</a> say: <a href="#comment-27586" rel="nofollow">@liuqiqi </a> 沙发你也自己抢，你还有节操吗？</li><li>2013年05月29日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-27586">liuqiqi</a> say: <span style="color:red;"><strong>美美的沙发。。。</strong></span> <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </li><li>2013年05月29日, <a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html#comment-27589">QiQiBoY</a> say: <a href="#comment-27587" rel="nofollow">@key4ever </a> 
不抢我就丢了节操泥。。。</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>刷一下存在感</title>
		<link>http://www.qiqiboy.com/2013/05/04/im-still-here.html</link>
		<comments>http://www.qiqiboy.com/2013/05/04/im-still-here.html#comments</comments>
		<pubDate>Fri, 03 May 2013 19:46:39 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[Myself-Life]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[卧槽]]></category>
		<category><![CDATA[旅行]]></category>
		<category><![CDATA[非技术]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2909</guid>
		<description><![CDATA[博客清明节前后挂掉，主机商说硬盘坏了，需要寄回来恢复数据（在美国）。于是等啊等啊 [...]]]></description>
				<content:encoded><![CDATA[<p>博客清明节前后挂掉，主机商说硬盘坏了，需要寄回来恢复数据（在美国）。于是等啊等啊的就到了五一了，硬盘还没影儿。于是只好把二月份的备份拿来用了。所以你目前看到的是从2013年2月初开始的数据。</p>
<p>不过，我2月 3月有写过博客吗？貌似没有吧。反正我不记得了。</p>
<p>一转眼，wordpress十周年了，google reader也被遗弃了。说实话，我确实很久没刷reader了，一方面是自己懒，还有一方面是上面的几百个订阅也很少更新了。很多当初的博主估计像我一样都可耻的匿了。</p>
<p>某日一论坛，一同学跟帖对我说，“我从高中的尾巴就开始关注你了，现在已经到了大学的尾巴了”。我一瞬间觉得焦虑感骤增，我老了。时间悄无声息的溜走，把人狠狠地摔在身后。</p>
<p>博客恢复后，我看了一眼文章存档，最后一篇更新是去年12月份，大概我离职上家公司的前几天。之后我去了云南旅行了三周（部分照片可见我的<a href="http://www.flickr.com/photos/qiqiboy/" target="_blank">flickr相册</a>）。</p>
<p>这几年来，我眼睁睁地瞅着QQ空间上大家从发男默女泪的美文到现在各种怀孕、孩子、房子的杂事，静悄悄的看着当初一起折腾wp的博友从博客更新wordpress技术文到各种家常、孩子、房子的博文。</p>
<p>虽然我不喜欢看到这些，但是还是祝福你们都幸福啦。</p>
<p>对了，最后自荐一下自己的一项目，<a href="http://wocao123.sinaapp.com/" target="_blank">卧槽！</a>。</p>
<p>这个项目源自去年12月份，我产生的删掉微博的想法，当时完成了一个雏形，一直是我自己在用。清明节时抽空完善了下，放到了sae上。</p>
<p>这个项目的功能就是，清理你的微博，可以暴力选择删除全部微博，也可以设置删除某一时间段内的微博。还可以设置删除xxx以前的微博。xxx是指距离当前的一段时间，比如删除一个月前的微博。卧槽！就会每天去抓取你的微博，然后删除符合“一个月前”的微博。</p>
<p>当然，不想使用自动清理，也可以手动批量删除微博。智能清理后台运行，无需人为干预。</p>
<p>卧槽！的用户现在已有五百余人，运行稳定。最快可在20小时内删除1.6W条微博（实际数据）。</p>
<p>卧槽！的地址: <a href="http://wocao123.sinaapp.com">http://wocao123.sinaapp.com</a></p>
<p><a href="http://www.qiqiboy.com/wp-content/uploads/2013/05/b9ba630a5ae3_10BFE/QQ20130430113155.png"><img title="QQ截图20130430113155" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="QQ截图20130430113155" src="http://www.qiqiboy.com/wp-content/uploads/2013/05/b9ba630a5ae3_10BFE/QQ20130430113155_thumb.png" width="450" height="300"></a></p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/themes/windPaled/images/default-thumb.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="如何快速为wordpress网站开发对外的数据接口" class="thumb" /><a href="http://www.qiqiboy.com/2013/05/29/quickly-develop-wordpress-api-interface.html" title="如何快速为wordpress网站开发对外的数据接口">如何快速为wordpress网站开发对外的数据接口</a> (8)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/07/img1_thumb.png&amp;h=100&amp;w=100&amp;zc=1" alt="社交媒体连接 V2 更新 更快更稳定更易用" class="thumb" /><a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html" title="社交媒体连接 V2 更新 更快更稳定更易用">社交媒体连接 V2 更新 更快更稳定更易用</a> (39)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/09/rrr.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 搜索自定义字段(模糊查询)" class="thumb" /><a href="http://www.qiqiboy.com/2011/09/14/query-posts-by-postmeta.html" title="wordpress 搜索自定义字段(模糊查询)">wordpress 搜索自定义字段(模糊查询)</a> (21)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/08/demo.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 按首字母排列文章/检索文章" class="thumb" /><a href="http://www.qiqiboy.com/2011/08/10/wordpress-search-post-by-first-char.html" title="wordpress 按首字母排列文章/检索文章">wordpress 按首字母排列文章/检索文章</a> (19)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/06/5.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress的微博时间显示方法" class="thumb" /><a href="http://www.qiqiboy.com/2011/06/10/sina-weibo-timestamp-function-2.html" title="wordpress的微博时间显示方法">wordpress的微博时间显示方法</a> (20)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fu">http://qiqi.boy.im/fu<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2013年06月6日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27804">tiandi</a> say: 应用用不到了，因为账号早就被封杀了。</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27598">yesure</a> say: 存在一下。</li><li>2013年05月20日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27503">wmtimes</a> say: 存在了一下， 又消失了。</li><li>2013年05月18日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27489">折子戏</a> say: 悲剧啊，看来要时时备份数据库啊，要不然挂掉真NM蛋痛！</li><li>2013年05月18日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27481">大发</a> say: 不错，把微博全删了，哈哈。</li><li>2013年05月18日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27478">QiQiBoY</a> say: <a href="#comment-27475" rel="nofollow">@W3Cshare </a> 
哈哈，感谢支持哈</li><li>2013年05月17日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27475">W3Cshare</a> say: 卧槽！很强大的项目</li><li>2013年05月11日, <a href="http://www.qiqiboy.com/2013/05/04/im-still-here.html#comment-27369">QiQiBoY</a> say:  <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_cool.gif' alt=':cool:' class='wp-smiley' />  死去活来啦</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2013/05/04/im-still-here.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>javascript节点拖动如何避免影响某些节点对象的默认行为</title>
		<link>http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html</link>
		<comments>http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html#comments</comments>
		<pubDate>Tue, 18 Dec 2012 10:06:56 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[开发]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[拖动]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2905</guid>
		<description><![CDATA[使用javascript开发可拖动组件时，往往需要对鼠标事件进行阻止默认行为操作 [...]]]></description>
				<content:encoded><![CDATA[<p>使用javascript开发可拖动组件时，往往需要对鼠标事件进行阻止默认行为操作。对于普通的节点对象，这个一般没什么问题（没有选择文字复制粘贴等需求），但是如果被拖动对象里包含了一些input、select等对象时，如果从一而终（mousestart ，mousemove，mouseend, click）全部preventDefault默认行为，则会使这些节点无法响应用户操作，比如聚焦input输入或者改变select的值。某些特殊情况下的需求（比如拖动是纵向单方向的，而另一方向横向上则需要可以用鼠标选择文字）更是一个不可能的任务。</p>
<p>进行拖动开发时，一般都是使用mousestart（鼠标按下）、mousemove（鼠标移动）、mouseend（鼠标抬起）这三个事件实现的，而click事件与这个事件也是有关系的，它是在mouseend后才会被触发的。</p>
<p>如果event.target是个链接，在经过前三个mouse事件后，click还是会,则会在拖动时看到图片或链接跟着鼠标有个拖影.所以在在此情况下,必须取消该默认行为. 如下图。<br /><a href="http://www.qiqiboy.com/wp-content/uploads/2012/12/tuoying.png"><img title="tuoying" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="tuoying" src="http://www.qiqiboy.com/wp-content/uploads/2012/12/tuoying_thumb.png" width="240" height="195"></a></p>
<p>普通页面上我们按住鼠标可以选择上一段文字,而这个行为不同浏览器的发生阶段也不一样,有的是取消mousestart行为就不会选择了,而有的则是取消mousemove则不会选择,有的则需要同时取消mousestart和mousemove.</p>
<p>综上,我总结了一下各种情况,在自己的开发中应用了以下方法来兼容各个浏览器.</p>
<p><strong>说明:以下例子均运行在标准浏览器环境. 对相关事件接口进行兼容,也是可以运行在ie等早期浏览器中的.</strong></p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #008000">//首先定义一个后面会用到的函数</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">function</span> returnFlase(evt){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     evt.preventDefault();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> }</pre>
</div>
</div>
<h3>首先是对于mousestart(touchstart)</h3>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> mousestart(evt){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">var</span> name=evt.target.nodeName.toLowerCase();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">if</span>(evt.type!=<span style="color: #006080">'touchstart'</span> &amp;&amp; ( <span style="color: #008000">//触摸设备上的浏览器就不需要了</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         name==<span style="color: #006080">'a'</span> ||</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>         name==<span style="color: #006080">'img'</span> ||</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     )) evt.preventDefault();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span>     <span style="color: #0000ff">this</span>.removeEventListener(<span style="color: #006080">'click'</span>,returnFalse,<span style="color: #0000ff">false</span>); <span style="color: #008000">//取消 阻止默认行为</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> }</pre>
</div>
</div>
<h3>对于mousemove(touchmove)</h3>
<p>在该事件中，最重要的是根据你的需求做出判断，比如是否锁定拖动方向、是否单方向拖动、是否有效拖动距离（ie下即使没有移动鼠标也有可能会触发mousemove）。如果用户确实执行了有效鼠标移动</p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> mousemove(evt){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #008000">// ....</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">if</span>(move){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         evt.preventDefault();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #008000">/* 这里是因为如果单方向拖动，会出现文字被选中的情况，这里需要去除文字选中效果 */</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>         <span style="color: #0000ff">if</span>(window.getSelection!=<span style="color: #0000ff">null</span>){<span style="color: #008000">//这里只需要考虑标准浏览器就行了，ie7 8下无此问题</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span>             range=getSelection();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>             <span style="color: #0000ff">if</span>(range.empty)range.empty();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span>             <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span>(range.removeAllRanges)range.removeAllRanges();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     <span style="color: #008000">// ....</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span> }</pre>
</div>
</div>
<h3>对于mouseend(touchend, touchcancel)</h3>
<p>该事件中,重要的是判断用户是否是拖动后抬起的鼠标操作, 如果是的话,则需要阻止click事件. 与第一步中相呼应,第一步中我们需要removeEventListener这一步中添加的函数</p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> mouseend(){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #008000">// ....</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">if</span>(move){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         <span style="color: #008000">/* 如果用户在第二步中有效拖动，则需要取消click事件的默认行为 */</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #0000ff">this</span>.addEventListener(<span style="color: #006080">'click'</span>,returnFalse,<span style="color: #0000ff">false</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span>     <span style="color: #008000">// ....</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> }</pre>
</div>
</div>
<p>如此以上处理后，拖动节点里的input select等都可以正常接收用户操作了。</p>
<p>说了不多也不少，没看懂就算了。我这里有个例子：<a title="http://u.boy.im/touchscroll/scroll.html" href="http://u.boy.im/touchscroll/scroll.html" target="_blank">http://u.boy.im/touchscroll/scroll.html</a></p>
<p>该例子是纵向拖动，横向是可以照常选择文字的。纵向拖动时也不会出现其它地方文字被选中的情况。</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 让拖动支持iphone/ipad触摸" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/16/javascript-touch-drag-support.html" title="JavaScript: 让拖动支持iphone/ipad触摸">JavaScript: 让拖动支持iphone/ipad触摸</a> (20)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/01/mouseEnter.png&amp;h=100&amp;w=100&amp;zc=1" alt="优化javascript中mouseover和mouseout事件" class="thumb" /><a href="http://www.qiqiboy.com/2011/01/19/javascript-mouseover-and-mouseout.html" title="优化javascript中mouseover和mouseout事件">优化javascript中mouseover和mouseout事件</a> (32)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/688860f891c5.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.0 - 兼容触摸屏手机与PC的幻灯片" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html" title="TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片">TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片</a> (26)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/09/rrr.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 搜索自定义字段(模糊查询)" class="thumb" /><a href="http://www.qiqiboy.com/2011/09/14/query-posts-by-postmeta.html" title="wordpress 搜索自定义字段(模糊查询)">wordpress 搜索自定义字段(模糊查询)</a> (21)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/08/demo.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress 按首字母排列文章/检索文章" class="thumb" /><a href="http://www.qiqiboy.com/2011/08/10/wordpress-search-post-by-first-char.html" title="wordpress 按首字母排列文章/检索文章">wordpress 按首字母排列文章/检索文章</a> (19)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/ft">http://qiqi.boy.im/ft<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2012年12月22日, <a href="http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html#comment-25614">furk</a> say: 测试一下留言</li><li>2012年12月19日, <a href="http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html#comment-25598">wmtimes</a> say: 原来是手机上的啊。</li><li>2012年12月18日, <a href="http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html#comment-25593">liuqiqi</a> say: <span style="color:red;"><strong>美美的沙发。。。</strong></span> <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_razz.gif' alt=':razz:' class='wp-smiley' /> </li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/12/18/javascript-cancel-preventdefault-element.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯</title>
		<link>http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html</link>
		<comments>http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comments</comments>
		<pubDate>Fri, 30 Nov 2012 11:02:21 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[幻灯]]></category>
		<category><![CDATA[触摸]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2902</guid>
		<description><![CDATA[很久很久以前，约么11个月以前，我在本博客发布了一个支持触屏和普通pc的幻灯sl [...]]]></description>
				<content:encoded><![CDATA[<p>很久很久以前，约么11个月以前，我在本博客发布了一个支持触屏和普通pc的幻灯slider组件：TouchSlider 1.0，经过后面几次连续的小的bug更新，版本稳定在1.0.5，就没再继续更新了。这个slider组件的主要特点是：1.支持自适应宽度容器 2. 支持手指拖动和鼠标拖动 3. 新增：随机宽度幻灯支持</p>
<p>转眼间春夏秋冬，物是人非。世纪末日前，我终于更新了该组件的1.2版本。在支持原来版本的所有特性上，新增加了支持不固定单个幻灯宽度的slider（比较绕口，看demo就明白了）。更新这一特性的原因是，原先的版本一次只能看到一个幻灯，随着容器宽度的变化，每个幻灯的宽度也被强制设置了和容易宽度一致！但是我的需求现在需要在容器变宽后，希望用户可以看到当前幻灯前后的那一张幻灯的部分局部。</p>
<p>先看Demo吧：</p>
<p align="center"><font size="4"><a href="http://u.boy.im/touchslider/" target="_blank"><strong>TouchSlider DEMO</strong></a></font></p>
<p>刚才所说的 不固定<u>单个</u>幻灯宽度的意思，即如demo里第一个例子所呈现的，该组幻灯有五个，每一个的宽度都不一样，有些甚至还设置了margin、padding、border等。随着容器宽度的变化，同时看到的幻灯会有多个。</p>
<p>其实这种类型的幻灯在appStore里就是这种，你在浏览应用的当前截图时，可以同时看到上一张和下一张的局部。</p>
<p>要实现这种效果，怎么在touchslider里设置呢？其实很简单：只要将fixWidth参数设置为false就行了（默认为true，即单个幻灯的宽度会被强制设置为容器的宽度）。</p>
<p><strong><font color="#ff0000">2012年12月2日更新</font></strong>：新增加align参数支持，（前提是fixWidth=false）align:left即可实现ipad版appstore上应用截图的展现方式，align:center即可实现iphone版appstore上应用截图的展现方式。具体请参见DEMO里的示例。</p>
<p>更多的TouchSlider使用技巧，请参看上边的DEMO里的说明。</p>
<p>需要特别注意的是，TouchSlider现在指定幻灯节点id时，需要指定该组幻灯父级容器的id（与旧版不同），并且不再限定为ul li结构。提供id或者目标节点给touchslider后，touchslider会将该节点的所有子节点转换为幻灯。</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #008000">&lt;!-- 例如，实现该组幻灯的正确写法是：TouchSlider('slider',{auto:true,speed:8000}) --&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">="slider"</span><span style="color: #0000ff">&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">="child"</span><span style="color: #0000ff">&gt;</span>1<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">="child"</span><span style="color: #0000ff">&gt;</span>2<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">="child"</span><span style="color: #0000ff">&gt;</span>3<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">="child"</span><span style="color: #0000ff">&gt;</span>4<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>

</div>
</div>
<p>如上，TouchSlider目前参数也变为两个了，也不用一定要用new方式来声明了。</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #008000">/**</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #008000"> * TouchSlider 1.2</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #008000"> * @param id string|node</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000"> * @param config object</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #008000"> * 也可以只有一个参数config，id在config对象里提供</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> <span style="color: #008000"> */</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #0000ff">function</span> TouchSlider(id,config){</pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     <span style="color: #008000">//code</span></pre>

<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060">   9:</span> }</pre>

</div>
</div>
<p>介绍就以上那么多了，下载demo包，请点击<a href="https://github.com/qiqiboy/touchslider" target="_blank">https://github.com/qiqiboy/touchslider</a></p>
<p>因为是这两天抽空更新的，时间比较紧，可能会有一些小bug，如有发现，欢迎留言告知。我要过周末了。</p>
<p>备注：我还写过一个类似这个非全宽幻灯的例子：<a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html">TouchSliderBox</a>，demo点击<a href="http://u.boy.im/sliderbox/" target="_blank"><strong>这里</strong></a>，两者效果差不多，稍微有区别。</p>
<p>备注2：将TouchSliderBox的例子用TouchSlider 1.2后的demo效果：<a title="http://u.boy.im/touchsliderbox/" href="http://u.boy.im/touchsliderbox/" target="_blank">http://u.boy.im/touchsliderbox/</a></p>
<p><a href="http://www.qiqiboy.com/wp-content/uploads/2012/11/QQ201211301832561.png"><img title="QQ截图20121130183256" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="QQ截图20121130183256" src="http://www.qiqiboy.com/wp-content/uploads/2012/11/QQ20121130183256_thumb.png" width="518" height="262"></a></p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/04/QQ20120409181449.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯" class="thumb" /><a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html" title="TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯">TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯</a> (13)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/04/touscroll.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案" class="thumb" /><a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html" title="TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案">TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案</a> (19)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/thumbcache/06.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="千变万化的幻灯效果&ndash;Banner Rotator FX" class="thumb" /><a href="http://www.qiqiboy.com/2011/03/19/banner-rotator-fx.html" title="千变万化的幻灯效果&ndash;Banner Rotator FX">千变万化的幻灯效果&ndash;Banner Rotator FX</a> (41)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/688860f891c5.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.0 - 兼容触摸屏手机与PC的幻灯片" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html" title="TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片">TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片</a> (26)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 支持iphone、ipad 使用两根手指放大图片" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/17/javascript-touch-support-zoom-image.html" title="JavaScript: 支持iphone、ipad 使用两根手指放大图片">JavaScript: 支持iphone、ipad 使用两根手指放大图片</a> (21)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fr">http://qiqi.boy.im/fr<a></p><span style="background:#cc5566;color:#fffff;"><h4>Look, this post is replyed so hot, let's go O(∩_∩)O~.</h4></span><h3>Related comments</h3><ul><li>2013年06月18日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-29128">IT</a> say: 在手机怎么不能自适应，我的是小屏手机</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27604">blex</a> say: 使用这个工具的路过表示支持</li><li>2013年05月30日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27603">blex</a> say: 抢占沙了个发</li><li>2013年05月28日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27560">QiQiBoY</a> say: <a href="#comment-27556" rel="nofollow">@eyeliving </a> 
没太明白你要实现的效果，有线上可以预览的地址么？
因为after是忽略幻灯是否变化的，页面重绘resize什么的都会触发after。也许你可以通过设置一个标识当前幻灯索引值的变量，当after被触发时，比较下此时的幻灯是否还是当前幻灯，如果有变化再执行callback</li><li>2013年05月27日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27557">eyeliving</a> say: <a href="#comment-27552" rel="nofollow">@QiQiBoY </a> 
额，

<a href="#comment-27556" rel="nofollow">@eyeliving </a> 
额，以上的问题的都已解决。
多谢 QiQiBoY ！good Buy！</li><li>2013年05月27日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27556">eyeliving</a> say: <a href="#comment-27552" rel="nofollow">@QiQiBoY </a> 
问题都已解决！but and 有一个新问题：感觉好像是bug 了，
我的demo 操作流程：进入页面，在某个默认 产品分类下面,首先加载两张幻灯片，滑动后，调用 TouchSlide 的 after callback function。这一步是正确的。
但是问题出来了：我选择产品的某个分类后，首先调用加载数据的function，加载两张幻灯片，再调用
TouchSlide 的 after callback function，但是 该方法 即after 调用了两次，如果再继续选择 产品的
某个分类，after 调用了三次，以此类推，问题也就是：点击产品分类，after就会 多执行一次。点击了5下产品分类，after 就会 多执行 5次。请教......</li><li>2013年05月27日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27552">QiQiBoY</a> say: <blockquote cite="#commentbody-27550">
<strong><a href="#comment-27550" rel="nofollow">eyeliving</a> :</strong>
<p><a href="#comment-27548" rel="nofollow">@eyeliving </a><br>
问题 已解决：but and 又一个新问题，操作流程：第一步，首先加载两张幻灯片，开始滑动，页面闪了一下，已经加载了一张，已经append，但是显示的还是第一张幻灯片，再次滑动，直接跳转到第三张 幻灯片。希望 LZ 指出 问题所在，谢谢！</p>
</blockquote>
由第一张跳到第三张？你可以确认下是不是append两个新幻灯时，顺序反了呢？
还有一种情况，就是你不是顺序滑动，第一张向前滑动prev时，会跳到最后一张上。</li><li>2013年05月27日, <a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html#comment-27550">eyeliving</a> say: <a href="#comment-27548" rel="nofollow">@eyeliving </a> 
问题 已解决：but and 又一个新问题，操作流程：第一步，首先加载两张幻灯片，开始滑动，页面闪了一下，已经加载了一张，已经append，但是显示的还是第一张幻灯片，再次滑动，直接跳转到第三张 幻灯片。希望 LZ 指出 问题所在，谢谢！</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>寥寥数语</title>
		<link>http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html</link>
		<comments>http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comments</comments>
		<pubDate>Sat, 29 Sep 2012 10:03:23 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[Myself-Life]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[单反]]></category>
		<category><![CDATA[无聊]]></category>
		<category><![CDATA[灌水]]></category>
		<category><![CDATA[生活]]></category>
		<category><![CDATA[科技]]></category>
		<category><![CDATA[闲聊]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2893</guid>
		<description><![CDATA[然后说点几个月来自己的购买的新玩意儿。首先是 macbook air和beats pro。这俩在一起简直是无敌装逼货。

air放在家里用来上网，非常棒。耳机放在上班地儿，白天工作时听音乐用的。所以这俩玩意儿我从来没一起用过，浪费了大大的装B利器。耳机我也没出街戴过。
beats pro性价比不高，买的就是亮骚的外观。虽说音质不能和同价位的耳机相提并论，但是我用的这几个月感受，还是很蛮满意的。唯一一点，就是金属机身，太沉了，我怀疑现在我脊椎病和戴这个耳机有关。]]></description>
				<content:encoded><![CDATA[<p>两个月前还在夏天的时候，我一直盼着秋天了。从07年开始，我就不喜欢夏天了。不是因为大大的太阳和偶尔超过40度的高温。</p>
<p>前两天发烧了，因为那晚突然而至的秋雨，晚上着了凉。发烧后让我也明白了一件事：有许多人能陪你一起开心，但是没有几个人能陪你一起难过。对我而言，目前没有。当然，这也正常，我也不想自己的情绪影响到别人。我也在避免别人的情绪影响到我。</p>
<p>然后说点几个月来自己的购买的新玩意儿。首先是 macbook air和beats pro。这俩在一起简直是无敌装逼货。<img title="61b11ad9jw1dvu3cq7wyuj" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="61b11ad9jw1dvu3cq7wyuj" src="http://www.qiqiboy.com/wp-content/uploads/2012/09/61b11ad9jw1dvu3cq7wyuj.jpg" width="446" height="334"></p>
<p>air放在家里用来上网，非常棒。耳机放在上班地儿，白天工作时听音乐用的。所以这俩玩意儿我从来没一起用过，浪费了大大的装B利器。耳机我也没出街戴过。</p>
<p>beats pro性价比不高，买的就是亮骚的外观。虽说音质不能和同价位的耳机相提并论，但是我用的这几个月感受，还是很蛮满意的。唯一一点，就是金属机身，太沉了，我怀疑现在我脊椎病和戴这个耳机有关。</p>
<p><img title="61b11ad9jw1dw4oa9id52j" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="61b11ad9jw1dw4oa9id52j" src="http://www.qiqiboy.com/wp-content/uploads/2012/09/61b11ad9jw1dw4oa9id52j.jpg" width="274" height="365"></p>
<p>后来又入手了个宾得单反。镜头参数就不说了，算个小牛头。就这一个镜头，单反穷三代，为了子孙的幸福，我觉得镜头投入上我该止步了。我也就是挂脖子上让自己看起来更像个游客，其它用处不大。反正到现在也没拍出过一张好照片。<img title="IMGP0053" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="IMGP0053" src="http://www.qiqiboy.com/wp-content/uploads/2012/09/IMGP0053.jpg" width="1024" height="683"></p>
<p>最近买的一个玩意儿是块手表，就不贴图了晒了。上个手表是石英表，大三末我自己换电池时给弄坏掉了。这次直接买了块机械表，不用再担心换电池的问题了，啊哈哈哈哈。</p>
<p>下个月要买的估计是手机，你懂的。</p>
<p>最后还要晒一下工作台。。哈哈。。两个大屁股对着，甭提多爽了。。（右边的thinkpad W520是去年末入的，用的机会不多）</p>
<p><img title="61b11ad9jw1dx11sbsb7nj" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="61b11ad9jw1dx11sbsb7nj" src="http://www.qiqiboy.com/wp-content/uploads/2012/09/61b11ad9jw1dx11sbsb7nj.jpg" width="690" height="517"></p>
<p><strong>微博出没：</strong><a href="http://weibo.com/qiqiboy" target="_blank">@qiqiboy</a> ，帝都混的请无情的微博私信我吃喝嫖赌。</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/61b11ad9tw1douqptegsnj.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="qiqiboy归来 - 纯吐槽" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/08/qiqiboy-coming-again.html" title="qiqiboy归来 &#8211; 纯吐槽">qiqiboy归来 &#8211; 纯吐槽</a> (50)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2009/10/20091023002_thumb.gif&amp;h=100&amp;w=100&amp;zc=1" alt="最近口腔溃疡+牙龈疼" class="thumb" /><a href="http://www.qiqiboy.com/2009/10/23/nothing-the-life.html" title="最近口腔溃疡+牙龈疼">最近口腔溃疡+牙龈疼</a> (4)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/05/200808311631407821.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="旅行在云南" class="thumb" /><a href="http://www.qiqiboy.com/2011/05/27/i-am-traveling-in-yun-nan.html" title="旅行在云南">旅行在云南</a> (38)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/04/thumb-2.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="国产神漫——《茗记2 - 初织恋》" class="thumb" /><a href="http://www.qiqiboy.com/2010/04/08/2end-life-2.html" title="国产神漫——《茗记2 &#8211; 初织恋》">国产神漫——《茗记2 &#8211; 初织恋》</a> (32)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/thumbcache/4042766103_67afd18bb4.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="Free Style[please tell me why]" class="thumb" /><a href="http://www.qiqiboy.com/2009/10/26/free-style.html" title="Free Style[please tell me why]">Free Style[please tell me why]</a> (9)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fq">http://qiqi.boy.im/fq<a></p><span style="background:#cc5566;color:#fffff;"><h4>Look, this post is replyed so hot, let's go O(∩_∩)O~.</h4></span><h3>Related comments</h3><ul><li>2013年02月3日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-26066">小红帽</a> say: 估计您老也会因为挂单反而驼背的  啊哈～～</li><li>2012年12月4日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25499">超人</a> say: 快来找我吃喝嫖赌！</li><li>2012年12月3日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25496">QiQiBoY</a> say: <a href="#comment-25341" rel="nofollow">@vega </a> 
嗯,是啊....</li><li>2012年12月3日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25495">儿童安全座椅</a> say: 电脑还挺多的</li><li>2012年11月26日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25372">looping</a> say: 不错，小伙子有前途</li><li>2012年11月25日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25367">小雪</a> say: 好久沒更新了啊親～

話說你這個首頁……好豐富，我頭好晕orz</li><li>2012年11月23日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25345">穿衣</a> say: 这设备真是帅气~</li><li>2012年11月21日, <a href="http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html#comment-25341">vega</a> say: qiqi住牡丹园么 <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_redface.gif' alt=':oops:' class='wp-smiley' /> </li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/09/29/nothing-to-say-fuck-u.html/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>javaScript 操作COOKIE</title>
		<link>http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html</link>
		<comments>http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comments</comments>
		<pubDate>Fri, 27 Jul 2012 01:45:45 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[前端]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2879</guid>
		<description><![CDATA[COOKIE，不是说的曲奇饼，吃货走开！ 最近用到了在前端需要使用javascr [...]]]></description>
				<content:encoded><![CDATA[<blockquote><p>COOKIE，不是说的曲奇饼，吃货走开！</p>
</blockquote>
<p>最近用到了在前端需要使用javascript对cookie进行操作，本来想找个现成的代码来用，无奈搜了半天没有找到。</p>
<p>于是自己写了个，也随手分享出来，凑个博客更新。。。。。</p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 600px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">var</span> COOKIE=(<span style="color: #0000ff">function</span>(){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">var</span> cookie=document.cookie||<span style="color: #006080">''</span>,</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>         subs=cookie.split(<span style="color: #006080">';'</span>),</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         cks={},</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>         trim=<span style="color: #0000ff">function</span>(str){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>             <span style="color: #0000ff">return</span> str.replace(/^\s+|\s+$/g,<span style="color: #006080">''</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span>         },</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         getDateString=<span style="color: #0000ff">function</span>(offset){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span>             <span style="color: #0000ff">var</span> date=<span style="color: #0000ff">new</span> Date();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>             date.setTime(+date+offset*1000);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span>             <span style="color: #0000ff">return</span> date.toGMTString();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>         }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span>     <span style="color: #0000ff">for</span>(<span style="color: #0000ff">var</span> i=0;i&lt;subs.length;i++){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>         <span style="color: #0000ff">var</span> _sub=subs[i];</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum15" style="color: #606060">  15:</span>         <span style="color: #0000ff">var</span> pos=_sub.indexOf(<span style="color: #006080">"="</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>         <span style="color: #0000ff">var</span> key,value;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum17" style="color: #606060">  17:</span>         <span style="color: #0000ff">if</span>(pos&gt;=0){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>             key=trim(_sub.substring(0,pos));</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum19" style="color: #606060">  19:</span>             value=_sub.substring(pos+1);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>             cks[unescape(key)]=unescape(value);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum21" style="color: #606060">  21:</span>         }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum23" style="color: #606060">  23:</span>  </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span>     <span style="color: #0000ff">return</span> {</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum25" style="color: #606060">  25:</span>         has:<span style="color: #0000ff">function</span>(key){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum26" style="color: #606060">  26:</span>             <span style="color: #0000ff">return</span> <span style="color: #0000ff">typeof</span> cks[key]!=<span style="color: #006080">'undefined'</span>;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum27" style="color: #606060">  27:</span>         },</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum28" style="color: #606060">  28:</span>         set:<span style="color: #0000ff">function</span>(key,value,expire,path,domain){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum29" style="color: #606060">  29:</span>             cks[key]=value;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum30" style="color: #606060">  30:</span>             <span style="color: #0000ff">var</span> myck=escape(key)+<span style="color: #006080">'='</span>+escape(value);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum31" style="color: #606060">  31:</span>             <span style="color: #0000ff">if</span>(<span style="color: #0000ff">typeof</span> expire!=<span style="color: #006080">'undefined'</span>)</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum32" style="color: #606060">  32:</span>                 myck+=<span style="color: #006080">';expires='</span>+getDateString(expire);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum33" style="color: #606060">  33:</span>             <span style="color: #0000ff">if</span>(<span style="color: #0000ff">typeof</span> path!=<span style="color: #006080">'undefined'</span>)</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum34" style="color: #606060">  34:</span>                 myck+=<span style="color: #006080">';path='</span>+path;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum35" style="color: #606060">  35:</span>             <span style="color: #0000ff">if</span>(<span style="color: #0000ff">typeof</span> domain!=<span style="color: #006080">'undefined'</span>)</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum36" style="color: #606060">  36:</span>                 myck+=<span style="color: #006080">';domain='</span>+domain;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum37" style="color: #606060">  37:</span>             document.cookie=myck;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum38" style="color: #606060">  38:</span>         },</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum39" style="color: #606060">  39:</span>         remove:<span style="color: #0000ff">function</span>(key){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum40" style="color: #606060">  40:</span>             delete cks[key];</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum41" style="color: #606060">  41:</span>             document.cookie=escape(key)+<span style="color: #006080">'=;path=/;expires='</span>+getDateString(-10000);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum42" style="color: #606060">  42:</span>         },</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum43" style="color: #606060">  43:</span>         get:<span style="color: #0000ff">function</span>(key){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum44" style="color: #606060">  44:</span>             <span style="color: #0000ff">return</span> cks[key];</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum45" style="color: #606060">  45:</span>         },</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum46" style="color: #606060">  46:</span>         cookies:cks</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum47" style="color: #606060">  47:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum48" style="color: #606060">  48:</span> })();</pre>
</div>
</div>
<p><img title="u=812244014,624370422&amp;fm=52&amp;gp=0" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="u=812244014,624370422&amp;fm=52&amp;gp=0" align="left" src="http://www.qiqiboy.com/wp-content/uploads/2012/07/u812244014624370422fm52gp0.jpg" width="220" height="168">相对于javascript，通过后端的php来操作cookie是更容易简单的。所以由于以前很少通过JS去操作cookie，在使用javascript操作cookie时遇到了一些弯路，也分享出来，免得大家跟我犯同样的错误。</p>
<p><strong>第一点</strong>，就是我知道document.cookie返回所有cookie组成的字符串，所以在设置cookie时，我想当然的以为是将新cookie拼接到该字符串上，再赋值给document.cookie就行了。</p>
<p>经过测试，完全不是这样，document.cookie=””; 是添加或更新新的cookie，比如document.cookie=”myck=yes;”则添加了个名字为myck的cookie；如果要同时添加多个cookie，document.cookie=”key1=1;key2=2;“ 就行了。如果要加上过期时间，存储域等信息，直接后面加上相关参数即可。比如：document.cookie=’myck=yes; expires=expire_time;domain=domain’。</p>
<p>该操作完全不影响已有的非同名cookie。</p>
<p><strong>第二点</strong>，设置cookie的过期时间时，我错误的以为是设置个时间戳就行了，结果测来测去，发现没有效，cookie有效期总是session周期。后来才发现要用标准字符串时间格式，类似”Mon Jul 23 2012 20:08:10 GMT+0800 GMT“。如果用1343045321299这种，则是无效的。</p>
<p>。。。。。。。额。。没了。。。</p>
<h3>如何使用？</h3>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #008000">//检测是否存在名字为abc的cookie</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> COOKIE.has(<span style="color: #006080">'abc'</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000">//获取名字为abc的cookie的值</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> COOKIE.get(<span style="color: #006080">'abc'</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #008000">//添加一个新cookie</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> COOKIE.set(<span style="color: #006080">'abc'</span>,<span style="color: #006080">'123'</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span> COOKIE.set(<span style="color: #006080">'abc'</span>,<span style="color: #006080">'123'</span>,7*24*3600);<span style="color: #008000">//带过期时间的，单位是秒</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span> <span style="color: #008000">//移除名字为abc的cookie</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> COOKIE.remove(<span style="color: #006080">'abc'</span>);</pre>
</div>
</div>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/11/6f03f20d5f8f.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="【JS温故知新】之&mdash;&mdash;给力的鼠标坐标位置获取" class="thumb" /><a href="http://www.qiqiboy.com/2010/11/19/coordinates-access-to-the-power-of-mouse.html" title="【JS温故知新】之&mdash;&mdash;给力的鼠标坐标位置获取">【JS温故知新】之&mdash;&mdash;给力的鼠标坐标位置获取</a> (53)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/688860f891c5.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.0 - 兼容触摸屏手机与PC的幻灯片" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html" title="TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片">TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片</a> (26)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 让拖动支持iphone/ipad触摸" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/16/javascript-touch-drag-support.html" title="JavaScript: 让拖动支持iphone/ipad触摸">JavaScript: 让拖动支持iphone/ipad触摸</a> (20)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/02/confirm.png&amp;h=100&amp;w=100&amp;zc=1" alt="javascript自定义Dialog对话框(alert, confirm, prompt) -- (一)" class="thumb" /><a href="http://www.qiqiboy.com/2011/02/22/custom-javascript-dialog-alert-prompt.html" title="javascript自定义Dialog对话框(alert, confirm, prompt) &#8212; (一)">javascript自定义Dialog对话框(alert, confirm, prompt) &#8212; (一)</a> (33)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/01/Pompidou_ZH-CN3304850761.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="终极完美版javascript获取并限制调整图片尺寸" class="thumb" /><a href="http://www.qiqiboy.com/2011/01/30/javascript-and-limit-access-to-adjust-the-picture-size.html" title="终极完美版javascript获取并限制调整图片尺寸">终极完美版javascript获取并限制调整图片尺寸</a> (45)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fp">http://qiqi.boy.im/fp<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2012年12月23日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-25622">furk</a> say: 看不懂，过来抽个热闹</li><li>2012年11月23日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-25346">ch</a> say: 好吧，其实我看不懂。。</li><li>2012年10月24日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-25012">超人</a> say: 别整的这么高级好么！！！</li><li>2012年09月22日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-24752">Fanr</a> say: 又专业了,那个饼干有点类似趣多多~</li><li>2012年09月21日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-24749">QiQiBoY</a> say: test456</li><li>2012年08月27日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-24609">asfdas</a> say: fadsfasf111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</li><li>2012年08月27日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-24608">代码王子</a> say: 楼主的cookie操作真是太牛逼了</li><li>2012年08月24日, <a href="http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html#comment-24598">wmtimes</a> say: 讲代码，我看不懂。
能写代码的感觉很牛啊。</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/07/27/use-cookie-with-javascript.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>社交媒体连接 V2 更新 更快更稳定更易用</title>
		<link>http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html</link>
		<comments>http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comments</comments>
		<pubDate>Sun, 08 Jul 2012 07:18:46 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[微博]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[社交媒体连接]]></category>
		<category><![CDATA[社交网站]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2872</guid>
		<description><![CDATA[从上次的V1.X版的最后一个版本1.7.4到现在已经差不多9个月没更新了。一方面 [...]]]></description>
				<content:encoded><![CDATA[<p>从上次的V1.X版的最后一个版本1.7.4到现在已经差不多9个月没更新了。一方面是工作忙，一方面是太懒。</p>
<p>本次更新V2版，完全是重写了所有的代码。最初构思V2版本是在四月初的时候，从开工到完成，过去了差不多快三个月了。</p>
<p>V2版与V1相比，主要是去掉了V1的“我的微博”功能。其它功能无变化，并且得到了大大的增强。</p>
<ol>
<li>部分微博的认证流程更新使用了OAuth2，更快更方便和安全。例如新浪微博、腾讯微博等。</li>
<li>支持的第三方网站更多，在以往的基础上，新增支持了google账号（google+）、雅虎Yahoo账号、百度、QQ号码、MSN、淘宝、360等。</li>
<li>文章同步更稳定。</li>
<li>支持多作者博客，支持网站用户绑定多个第三方账号。</li>
</ol>
<p>插件下载地址：<a title="http://wordpress.org/extend/plugins/social-medias-connect/" href="http://wordpress.org/extend/plugins/social-medias-connect/">http://wordpress.org/extend/plugins/social-medias-connect/</a></p>
<p>插件FAQ：<a href="http://www.qiqiboy.com/products/plugins/social-medias-connect">http://www.qiqiboy.com/products/plugins/social-medias-connect</a></p>
<p>插件效果预览：本站。</p>
<p>插件部分截图：<a href="http://www.qiqiboy.com/wp-content/uploads/2012/07/img1.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="img1" src="http://www.qiqiboy.com/wp-content/uploads/2012/07/img1_thumb.png" alt="img1" width="978" height="634" border="0" /></a></p>
<p>欢迎各位试用，如果觉得好，请广而告之。。。哈哈</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/09/ty.png&amp;h=100&amp;w=100&amp;zc=1" alt="社交媒体连接 V1.6更新 支持facebook 完全重写的注册流程" class="thumb" /><a href="http://www.qiqiboy.com/2011/09/16/socila-medias-connect-1-6-update.html" title="社交媒体连接 V1.6更新 支持facebook 完全重写的注册流程">社交媒体连接 V1.6更新 支持facebook 完全重写的注册流程</a> (46)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/05/fanfousmc.png&amp;h=100&amp;w=100&amp;zc=1" alt="有关社交媒体连接插件对饭否、follow5支持的说明" class="thumb" /><a href="http://www.qiqiboy.com/2011/05/12/social-medias-connect-about-fanfou-and-follow5.html" title="有关社交媒体连接插件对饭否、follow5支持的说明">有关社交媒体连接插件对饭否、follow5支持的说明</a> (32)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/04/a9dff5b61cf6.png&amp;h=100&amp;w=100&amp;zc=1" alt="WordPress插件发布: Social Medias Connect" class="thumb" /><a href="http://www.qiqiboy.com/2011/04/15/publish-social-medias-connect.html" title="WordPress插件发布: Social Medias Connect">WordPress插件发布: Social Medias Connect</a> (86)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/04/ttt.png&amp;h=100&amp;w=100&amp;zc=1" alt="新玩意儿-Social Medias Connect 微博连接" class="thumb" /><a href="http://www.qiqiboy.com/2011/04/14/social-medias-connect-plugin.html" title="新玩意儿-Social Medias Connect 微博连接">新玩意儿-Social Medias Connect 微博连接</a> (67)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/06/5.png&amp;h=100&amp;w=100&amp;zc=1" alt="wordpress的微博时间显示方法" class="thumb" /><a href="http://www.qiqiboy.com/2011/06/10/sina-weibo-timestamp-function-2.html" title="wordpress的微博时间显示方法">wordpress的微博时间显示方法</a> (20)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fo">http://qiqi.boy.im/fo<a></p><span style="background:#cc5566;color:#fffff;"><h4>Look, this post is replyed so hot, let's go O(∩_∩)O~.</h4></span><h3>Related comments</h3><ul><li>2013年02月15日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-26178">凤翼天堂</a> say: 腾讯微博 token获取失败（code to access token error）T T</li><li>2013年01月4日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-25690">keyibai</a> say: 非常不错的一个扩展，谢谢！有个问题报告下：一个Facebook page(https://www.facebook.com/keyibai)显示绑定成功，但是无法同步，不知何故？</li><li>2012年12月6日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-25509">cheap nfl nike jerseys</a> say: 真的很强悍啊。先支持一下下。</li><li>2012年11月30日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-25462">第三眼</a> say: 完全自己写的，牛！期待加入twitter和facebook</li><li>2012年11月27日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-25379">少女时代-哦</a> say: 什么意思？我都搞不懂，是连接还是做什么的呀？</li><li>2012年09月25日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-24772">odayou</a> say: "对不起，该微博已经绑定了其他帐号"是麽子个意识？绑定百度也是这个提示，博主能帮忙解答下吗</li><li>2012年08月29日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-24633">红袖女装</a> say: hopeshow now.文章不错。</li><li>2012年08月28日, <a href="http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html#comment-24624">80memo</a> say: <a href="#comment-24331" rel="nofollow">@QiQiBoY </a> 是最新版的啊，也是管理员的，不知道什么原因</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/07/08/social-medias-connnect-v1-7-publish.html/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>TouchSliderBox 1.0 &#8211;容器宽度可变的幻灯</title>
		<link>http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html</link>
		<comments>http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comments</comments>
		<pubDate>Mon, 09 Apr 2012 10:23:24 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[幻灯]]></category>
		<category><![CDATA[触摸]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html</guid>
		<description><![CDATA[之前写过一个《TouchSlider 1.0 – 兼容触摸屏手机与PC的幻灯片》 [...]]]></description>
				<content:encoded><![CDATA[<p>之前写过一个《<a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html">TouchSlider 1.0 – 兼容触摸屏手机与PC的幻灯片</a>》，那么这个TouchSliderBox和之前的TouchSlider有什么区别呢？</p>
<p>TouchSlider是支持幻灯宽度自适应的，也就是支持Responsive Layout（响应式布局）设计的页面上的slider。而TouchSliderBox其实也是支持响应式布局页面的，只不过每个幻灯的宽度是固定的，变化的是包围幻灯片的容器的宽度。其实差别就是TouchSlider你只能一次看到一张幻灯，而TouchSliderBox则随着幻灯容器宽度的不同，你可能同时可以看到多个幻灯片。</p>
<p>用一副图片来解释：<img title="slider" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="slider" src="http://www.qiqiboy.com/wp-content/uploads/2012/04/slider.jpg" width="600" height="442"></p>
<p>如上图，黄色线框即为幻灯容器。</p>
<h3>为什么开发这个</h3>
<p>这个主要是用来展示图片的，虽然TouchSlider也可以用来展示图片，但是由于每次只能显示一张图片，浪费了页面空间（在响应式布局中，从320到1920宽度都支持的话）。</p>
<p>还有一个原因就是模仿苹果的AppStore的页面下部的应用截图：</p>
<p><img title="QQ截图20120409181449" style="display: inline" alt="QQ截图20120409181449" src="http://www.qiqiboy.com/wp-content/uploads/2012/04/QQ20120409181449.png" width="400" height="328">
<p>使用TouchSliderBox可以做到所有浏览器上保持样式统一，并且支持前后切换、鼠标滚动切换以及自适应页面宽度。</p>
<h3>如何使用</h3>
<p>使用方法，先载入前一篇文章中提到的那个TouchScroll脚本，然后再载入TouchSliderBox的脚本文件，然后可以通过调用TouchSliderBox这个函数来使用：</p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span> src=<span style="color: #006080">"http://qiqiboy.sinaapp.com/touchscroll/touchScroll.js"</span>&gt;&lt;/script&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span> src=<span style="color: #006080">"http://qiqiboy.sinaapp.com/sliderbox/touchSliderBox.dev.js"</span>&gt;&lt;/script&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span>&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #008000">//第一个参数是幻灯所在容器的id，第二个参数为返回的幻灯实例的所附加的全局变量，可省略</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> TouchSliderBox(<span style="color: #006080">'imgbox'</span>,<span style="color: #006080">'t1'</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> &lt;/script&gt;</pre>
</div>
</div>
<p>为什么要载入TouchScroll呢？因为TouchSliderBox是基于TouchScroll开发的，也可以说是扩展了TouchScroll的一个插件，所以你需要预先载入TouchScroll。当然，你也可以只载入TouchSliderBox，然后会自动在页面中引入TouchScroll： </p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span> src=<span style="color: #006080">"http://qiqiboy.sinaapp.com/sliderbox/touchSliderBox.dev.js"</span>&gt;&lt;/script&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span>&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000">//第一个参数是幻灯所在容器的id，第二个参数为返回的幻灯实例的所附加的全局变量，可省略</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> TouchSliderBox(<span style="color: #006080">'imgbox'</span>,<span style="color: #006080">'t1'</span>);</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> <span style="color: #008000">/*不引入TouchScroll，这样子也是可以工作的*/</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> &lt;/script&gt;</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>&nbsp; </pre>
</div>
</div>
<p>具体的效果以及使用可以参见我提供的 <a href="http://u.boy.im/sliderbox/" target="_blank">DEMO</a><strong></strong> （可以用你的安卓或者苹果手机访问<a title="http://u.boy.im/sliderbox/" href="http://u.boy.im/sliderbox/">http://u.boy.im/sliderbox/</a> 体验。PC用户可以使用鼠标拖拽模拟触摸操作）。可以通过改变浏览器宽度或者横竖屏切换来查看幻灯的自适应效果。</p>
<p>JS的源码可以<a href="http://qiqiboy.googlecode.com/svn/trunk/myJS/touchSliderBox.dev.js" target="_blank">点此查看</a>。</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/11/QQ20121130183256_thumb.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.2发布 - 支持宽度不固定幻灯" class="thumb" /><a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html" title="TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯">TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯</a> (22)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/04/touscroll.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案" class="thumb" /><a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html" title="TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案">TouchScroll 1.0 &ndash; 统一视觉样式的容器滚动解决方案</a> (19)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/688860f891c5.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.0 - 兼容触摸屏手机与PC的幻灯片" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html" title="TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片">TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片</a> (26)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 支持iphone、ipad 使用两根手指放大图片" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/17/javascript-touch-support-zoom-image.html" title="JavaScript: 支持iphone、ipad 使用两根手指放大图片">JavaScript: 支持iphone、ipad 使用两根手指放大图片</a> (21)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 让拖动支持iphone/ipad触摸" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/16/javascript-touch-drag-support.html" title="JavaScript: 让拖动支持iphone/ipad触摸">JavaScript: 让拖动支持iphone/ipad触摸</a> (20)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fn">http://qiqi.boy.im/fn<a></p><span style="background:#cc5566;color:#fffff;"><h4>Hi,welcome to leave your reply.</h4></span><h3>Related comments</h3><ul><li>2012年11月30日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-25476">TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯 - I&#039;m qiqiboy !</a> say: [...] 备注：我还写过一个类似这个非全宽幻灯的例子：TouchSliderBox，demo点击这里，两者效果差不多，稍微有区别。 [...]</li><li>2012年11月11日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-25227">kictpov</a> say: 效果很好，我想去掉垂直滚动的功能可不可以啊？怎么去掉啊？还请赐教！</li><li>2012年10月30日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-25052">深蓝心语</a> say: 楼主，有没考虑到一个问题啊？
跟APPSTORE一样，同时有几万个产品的时候，怎么加载？
APP STORE是异步加载的</li><li>2012年04月20日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-18037">wmtimes</a> say: 现在都开始进军手机了哈。我还在原地经。唉。</li><li>2012年04月12日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-17979">瘦腿精油</a> say: 移动平台是趋势啊</li><li>2012年04月10日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-17971">博彩通</a> say: 嗯 不错  拿moto860试试</li><li>2012年04月10日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-17966">qiqiboy</a> say: <a href="#comment-17932" rel="nofollow">@Veezy </a> 
 <img src='http://www.qiqiboy.com/wp-content/themes/windPaled/images/smiles/icon_mad.gif' alt=':mad:' class='wp-smiley' />  多么优良的习惯，我长久坚持下来了</li><li>2012年04月10日, <a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html#comment-17965">qiqiboy</a> say: <a href="#comment-17957" rel="nofollow">@不能吧 </a> 
哈哈，这个其实是基于我上一篇文章里的TouchScroll的，所以还得载入那个脚本才行。不过总的代码量却是也不多，一共不到10K</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>TouchScroll 1.0 &#8211; 统一视觉样式的容器滚动解决方案</title>
		<link>http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html</link>
		<comments>http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comments</comments>
		<pubDate>Sun, 01 Apr 2012 08:20:40 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[触摸]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/?p=2860</guid>
		<description><![CDATA[大概三个月之前，我发布了一个JS组件，《 TouchSlider 1.0 – 兼 [...]]]></description>
				<content:encoded><![CDATA[<p>大概三个月之前，我发布了一个JS组件，《 <a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html"><strong>TouchSlider 1.0 – 兼容触摸屏手机与PC的幻灯片</strong></a> 》。后来陆续在项目中都有用到，觉自己得还是很方便的。</p>
<p>今天，我又带来了自己空余时间写的另一个组件，<strong>TouchScroll。</strong><font color="#ff0000">它最大程度上模拟了ios上的默认UI组件的滚动条效果。</font></p>
<h3>为什么开发这个东西</h3>
<p>其实很大一部分原因是自己想通过写这么一个东西来更好地熟悉PC和触屏手机的JS开发方案中的差别和特点。当然还有一个原因当然就是有可能项目中会用到这个，例如，在多栏功能页面中。</p>
<p>在页面上，一个容器如果内容的尺寸超过容器的大小，会自动出现滚动条，这个滚动条在不同浏览器中时各有差别的（windows 8上的IE的滚动条的metro风更是颠覆了IE多年的滚动条样式），并且自定义样式性也各不相同（如IE和chrome的通过css改变滚动条的方法就很不一样）或不可定义。而且，在IOS4上，出现滚动条的容器是不可被手指滚动浏览的（IOS5上的safair已经没有这个问题了），你一拖动页面，总是整个网页被拖动了。</p>
<p>而TouchScroll正是解决这个问题的，并且它在所有PC和手机浏览器上提供了统一的滚动条样式。PC上<strong><font color="#ff0000">支持鼠标拖动页面浏览或者拖动滚轮来滚动容器</font></strong>，手机上支持手指滑动滚动容器。它也支持自适应大小的容器（目前有一些类似插件则是渲染出不可改变大小的容器）。TouchScroll压缩后只有8K。</p>
<h3>TouchScroll开发注意的问题</h3>
<p>首先是用不用css3，TouchScroll我前后开发了两版，第一版在支持css3的浏览器上，容器的移动以及缓动效果均有css3提供，在IE上则有JS动画提供缓动效果。这个版本遇到了一个我无法解决的问题（因为要兼容IE，所以我没用translate，而是普通的绝对定位absolute，这样子遇到了滚动条动画中时的位置定位问题，没找到解决办法），关于css3的，后来又由于各种原因，这个版本放弃了，又重新开发了目前这个版本。这个版本里的缓动效果是由JS支持的。</p>
<p>还遇到一个快速移动后的缓动问题，需要取一定时间内的移动距离以及时间来计算加速度并从而计算出缓动的距离以及开始的速度。最后我是在拖动过程中（moveEvent）记录了每一次的时间与坐标，然后在拖动结束时（endEvent），取最后不大于200ms内的时间和距离，从而以此推算出需要缓动的距离和速度。大概过程如下： </p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">var</span> disc=[[<span style="color: #008000">/*时间*/</span>],[<span style="color: #008000">/*坐标*/</span>]]; <span style="color: #008000">//disc是用来保存时间与坐标的二维数组</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">var</span> getMousePoint=<span style="color: #0000ff">function</span>(){....} <span style="color: #008000">//获取鼠标坐标</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000">/* 每一次触发moveEvent时记录当前的时间与坐标 */</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> moveEvent=<span style="color: #0000ff">function</span>(){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     ....</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span>     disc.push(<span style="color: #0000ff">new</span> Date());</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     disc.push(getMousePoint());</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span>     ....</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span> }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span>&nbsp; </pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> endEvent=<span style="color: #0000ff">function</span>(){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span>     ....</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>     <span style="color: #008000">//计算出最近不超过200豪秒内数据</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum15" style="color: #606060">  15:</span>     <span style="color: #0000ff">var</span> nowTime=<span style="color: #0000ff">new</span> Date(),</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>         nowPos=getMousePoint();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum17" style="color: #606060">  17:</span>     <span style="color: #0000ff">while</span>(disc[0].length &amp;&amp; nowTime-disc[0][0]&gt;200){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>         disc[0].shift();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum19" style="color: #606060">  19:</span>         disc[1].shift();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum21" style="color: #606060">  21:</span>     <span style="color: #0000ff">if</span>(disc[0].length){</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>         time=nowTime-disc[0][0];<span style="color: #008000">//间隔时间</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum23" style="color: #606060">  23:</span>          offX=nowPos.x-disc[0][1].x;<span style="color: #008000">//横向间隔距离</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span>           ...</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum25" style="color: #606060">  25:</span>     }</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum26" style="color: #606060">  26:</span>     ....</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum27" style="color: #606060">  27:</span> }</pre>
</div>
</div>
<h3>TouchScroll如何使用</h3>
<p>使用方法，载入TouchScroll的脚本文件，然后可以通过实例化“TouchScroll”这个类来使用。例如： </p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">new</span> TouchScroll({</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #006080">'id'</span>: <span style="color: #006080">'slider'</span>,<span style="color: #008000">//要处理的容器的id</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #006080">'width'</span>:4,<span style="color: #008000">//滚动条宽度</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     <span style="color: #006080">'minLength'</span>:20,<span style="color: #008000">//滚动条最小长度</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #006080">'opacity'</span>:0.8,<span style="color: #008000">//滚动条透明度</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #006080">'color'</span>:<span style="color: #006080">'black'</span>,<span style="color: #008000">//滚动条颜色</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> });</pre>
</div>
</div>
<h3>TouchScroll还存在的问题</h3>
<p>目前可能还存在一些bug，另外在滚动超出边界后的动画处理也不是很理想，过渡有点生硬。</p>
<p>目前TouchScroll也未提供一些操作接口，我会在日后慢慢完善，包括添加<strike>PC上的鼠标滚动支持</strike>(已添加)、更多自定义内容等。</p>
<p><strong>目前可以使用的接口:</strong></p>
<div id="codeSnippetWrapper" style="cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; overflow: auto; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">var</span> t1=<span style="color: #0000ff">new</span> TouchScroll();</pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #008000">/*容器滚动接口</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #008000"> *@param Number offx: 水平方向上滚动offx距离</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000"> *@param Number offy: 垂直方向上滚动offy距离</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #008000"> */</span></pre>

<pre style="border-top-style: none; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; overflow: visible; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> t1.scroll(offx,offy);</pre>
</div>
</div>
<p>查看<a href="http://u.boy.im/touchscroll/" target="_blank">DEMO</a><strong></strong>请点击<a title="http://u.boy.im/touchscroll/" href="http://u.boy.im/touchscroll/">http://u.boy.im/touchscroll/</a>。可以使用手机浏览器输入地址访问。</p>
<p>DEMO2: <a title="http://u.boy.im/touchscroll/scroll.html" href="http://u.boy.im/touchscroll/scroll.html">http://u.boy.im/touchscroll/scroll.html</a></p>
<p>查看源代码<a href="http://qiqiboy.googlecode.com/svn/trunk/myJS/touchScroll.dev.js" target="_blank">请点此处</a>。</p>
<p><img title="touscroll" style="display: inline" alt="touscroll" src="http://www.qiqiboy.com/wp-content/uploads/2012/04/touscroll.png" width="520" height="262"></p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/04/QQ20120409181449.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯" class="thumb" /><a href="http://www.qiqiboy.com/2012/04/09/touchsliderbox-v1-0-publish-2.html" title="TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯">TouchSliderBox 1.0 &ndash;容器宽度可变的幻灯</a> (13)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 支持iphone、ipad 使用两根手指放大图片" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/17/javascript-touch-support-zoom-image.html" title="JavaScript: 支持iphone、ipad 使用两根手指放大图片">JavaScript: 支持iphone、ipad 使用两根手指放大图片</a> (21)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/11/QQ20121130183256_thumb.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.2发布 - 支持宽度不固定幻灯" class="thumb" /><a href="http://www.qiqiboy.com/2012/11/30/touchslider-1-2-publish.html" title="TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯">TouchSlider 1.2发布 &#8211; 支持宽度不固定幻灯</a> (22)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2012/01/688860f891c5.png&amp;h=100&amp;w=100&amp;zc=1" alt="TouchSlider 1.0 - 兼容触摸屏手机与PC的幻灯片" class="thumb" /><a href="http://www.qiqiboy.com/2012/01/11/touchslider-1-0-publish.html" title="TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片">TouchSlider 1.0 &#8211; 兼容触摸屏手机与PC的幻灯片</a> (26)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2011/07/810CI55J_0.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="JavaScript: 让拖动支持iphone/ipad触摸" class="thumb" /><a href="http://www.qiqiboy.com/2011/07/16/javascript-touch-drag-support.html" title="JavaScript: 让拖动支持iphone/ipad触摸">JavaScript: 让拖动支持iphone/ipad触摸</a> (20)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fk">http://qiqi.boy.im/fk<a></p><span style="background:#cc5566;color:#fffff;"><h4>Look, this post is replyed so hot, let's go O(∩_∩)O~.</h4></span><h3>Related comments</h3><ul><li>2013年02月2日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-26061">cheap nfl nike jerseys</a> say: 我很想说的是这个留言做的太酷了。有点像明信片。</li><li>2012年07月12日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-24192">睡眠博士旗舰店</a> say: 文章不错90524</li><li>2012年07月7日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-21529">QiQiBoY</a> say: <a href="#comment-21481" rel="nofollow">@wiiking </a> 
http://www.qiqiboy.com/products/plugins/social-medias-connect</li><li>2012年07月7日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-21481">wiiking</a> say: 为什么用新浪微博登录反映这么慢！  2.01放出来了？求下载地址亲！</li><li>2012年07月6日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-21058">geme_over</a> say: sinaapp上下载不了，求下载地址，email：z11750@gmail.com。 先谢了</li><li>2012年07月6日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-20924">广州骨科</a> say: 我正找这个 就放出来了 很不错的</li><li>2012年06月15日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-19089">fugui</a> say: 这是手机的?未来的主流啊</li><li>2012年05月21日, <a href="http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html#comment-18362">www.</a> say: 是做移动开发的？</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/04/01/touchscroll-v1-0-publish.html/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>注意，有骗子。。。。。13790942055</title>
		<link>http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html</link>
		<comments>http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comments</comments>
		<pubDate>Fri, 23 Mar 2012 02:11:22 +0000</pubDate>
		<dc:creator>QiQiBoY</dc:creator>
				<category><![CDATA[Myself-Life]]></category>
		<category><![CDATA[骗子]]></category>

		<guid isPermaLink="false">http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html</guid>
		<description><![CDATA[昨晚接到一电话： 骗子：“XX，我到天津办事儿。你能猜到我是谁么？” 我：“额。 [...]]]></description>
				<content:encoded><![CDATA[<p>昨晚接到一电话：</p>
<p>骗子：“XX，我到天津办事儿。你能猜到我是谁么？”</p>
<p>我：“额。。。你是A还是B？”</p>
<p>骗子：“嗯，对。”（我从这里开始以为对方就是B了）</p>
<p>我：“你不是在国外么，怎么突然回来了”</p>
<p>骗子：“。。。。。。。”<br />
骗子：“明天我去北京找你。”<br />
我：“好。”</p>
<p>=========================== 第一部分结束============================</p>
<p>第二天，</p>
<p>骗子：“XX，我这边办事儿钱不够了，先借我点钱行不？8K就行了”</p>
<p>我：“你的卡号发我？”（我很信任这个朋友，虽然我觉得以他的财力根本不可能去借钱）</p>
<p>骗子：“我没带卡，我发你我朋友的卡”</p>
<p>我此时才觉得对方肯定是个骗子，因为谁回国会他妈的忘记带银行卡！！！</p>
<p>于是我登陆了gtalk，发现这位朋友在线。</p>
<p>我灵机一动，要骗子在gtalk上给我发个消息。</p>
<p>骗子：“你是不信任我是吧？”</p>
<p>我：“你用gtalk给我发个消息我就给你转钱”</p>
<p>骗子：“啥？”（骗子估计没听过gtalk，只会QQ）<br />
“你是不相信我是吧”（此时骗子提高了分贝数）</p>
<p>我gtalk问了下我朋友，他说他没回过，还在澳洲。所以这时可以确定被骗了。<br />
我：“我操你姑奶奶的二舅的妹的。。。。……%&amp;&amp;*&amp;*”</p>
<p>骗子：“。。。。嘟嘟嘟”（挂电话了）</p>
<p>。。。。。。。。</p>
<p>我此刻满脸黑线。。。。</p>
<p>=========================== 第二部分结束============================</p>
<p>骗子骗术：事先得到你的手机号和你的名字，然后打电话给你，让你猜他的名字，在你说出了你朋友名字时，他顺势说你猜对了，他就是你说的那个人。然后并不急于立马向你要钱，他会说明天到你那里去找你。等到第二天，他会再给你打电弧找借口借钱。</p>
<p>骗子电话：<strong><span style="font-size: small;">13790942055</span></strong></p>
<p>求骚扰，求组队攻击骗子啊！！！！大家可以去和骗子玩玩。。没准你还能从它那里骗来钱呢。。</p>
<ul class="related_post"><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/themes/windPaled/images/default-thumb.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="Social Medias Connect（社交媒体连接）" class="thumb" /><a href="http://www.qiqiboy.com/products/plugins/social-medias-connect" title="Social Medias Connect（社交媒体连接）">Social Medias Connect（社交媒体连接）</a> (541)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/themes/windPaled/images/default-thumb.jpg&amp;h=100&amp;w=100&amp;zc=1" alt="Guestbook" class="thumb" /><a href="http://www.qiqiboy.com/guestbook" title="Guestbook">Guestbook</a> (414)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/08/1de9fb000bac.png&amp;h=100&amp;w=100&amp;zc=1" alt="插件发布：边栏最新评论及ajax回复——WP RC Reply AJAX" class="thumb" /><a href="http://www.qiqiboy.com/2010/08/20/wordpress-plugin-wp-rc-reply-ajax.html" title="插件发布：边栏最新评论及ajax回复——WP RC Reply AJAX">插件发布：边栏最新评论及ajax回复——WP RC Reply AJAX</a> (193)</li><li><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/08/spam5.png&amp;h=100&amp;w=100&amp;zc=1" alt="围观wordpress中文圈内好玩的spam" class="thumb" /><a href="http://www.qiqiboy.com/2010/08/31/chinese-circle-surrounding-wordpress-spam-fun.html" title="围观wordpress中文圈内好玩的spam">围观wordpress中文圈内好玩的spam</a> (133)</li><li class="last"><img src="http://www.qiqiboy.com/wp-content/themes/windPaled/timthumb.php?src=http://www.qiqiboy.com/wp-content/uploads/2010/8c442710e869_BD9F/wp-enjoy-reading.png&amp;h=100&amp;w=100&amp;zc=1" alt="【插件发布】WP Enjoy Reading(尽享阅读)" class="thumb" /><a href="http://www.qiqiboy.com/2010/10/10/wordpress-plugin-wp-enjoy-reading.html" title="【插件发布】WP Enjoy Reading(尽享阅读)">【插件发布】WP Enjoy Reading(尽享阅读)</a> (133)</li></ul><p><strong>声明:</strong> 本站遵循 <a href="http:\/\/creativecommons.org/licenses/by-nc-sa/3.0/">署名-非商业性使用-相同方式共享 3.0</a> 共享协议. 转载请注明转自 <a href="http://www.qiqiboy.com">I'm qiqiboy !</a> </p> <p>本文地址: <a href="http://qiqi.boy.im/fi">http://qiqi.boy.im/fi<a></p><span style="background:#cc5566;color:#fffff;"><h4>Look, this post is replyed so hot, let's go O(∩_∩)O~.</h4></span><h3>Related comments</h3><ul><li>2012年12月22日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-25619">furk</a> say: 这种骗人技俩太常见了，小心点。</li><li>2012年10月22日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24999">雨樹&amp;烏鴉</a> say: 记得N年以前在天津就接到过这种电话，当时还跟女朋友一起研究怎样招待远方来的朋友呢，后来对方提钱，所以就提高了警惕，哈哈，妹的，再后来就经常接这样的电话，索性聊呗，反正也是那个王八犊子花长途话费。。。。</li><li>2012年09月15日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24730">行客工作室</a> say: 这个太不好玩了 应该直接说好的 我马上给你汇款 然后呆着不动 一会他肯定又来电话 说已经在去银行的路上了 ，堵车 依然不动 ……马上就到了 已经汇了 你再看看 是不是银行系统出问题了 什么什么的 其实依然坐着不动—— 玩死他</li><li>2012年09月8日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24696">ross</a> say: 楼主听声音识别不出来它是不是你的同学？我想，一般听声音应该就有所怀疑了！</li><li>2012年09月1日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24635">秦大少</a> say: 可以拿这个号码玩玩，不过估计对骗子也没多大影响，换号太容易了。</li><li>2012年08月20日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24565">Minmi</a> say: <a href="#comment-24562" rel="nofollow">@超人 </a> 
超人！</li><li>2012年08月20日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24564">Minmi</a> say: <a href="#comment-24560" rel="nofollow">@QiQiBoY </a> 
恩哼！！！ =w=</li><li>2012年08月19日, <a href="http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html#comment-24562">超人</a> say: 哈哈。原来真有这样的骗子。。老骗术了</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.qiqiboy.com/2012/03/23/there-is-a-cheater.html/feed</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
	</channel>
</rss>
