<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>风牛菜籽 &#187; 设计</title>
	<atom:link href="http://www.caiyanpei.com/tag/%e8%ae%be%e8%ae%a1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.caiyanpei.com</link>
	<description>拖延症重症患者</description>
	<lastBuildDate>Tue, 25 Mar 2025 01:51:19 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6.1</generator>
		<item>
		<title>jquery实现有默认内容的展开收起效果</title>
		<link>http://www.caiyanpei.com/jquery-flip/</link>
		<comments>http://www.caiyanpei.com/jquery-flip/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 09:34:55 +0000</pubDate>
		<dc:creator>tsai</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://cyp.me/?p=225</guid>
		<description><![CDATA[前些天在实现一个网站的需求：1、展示一个分类里边的条目；2、默认显示前十条，并显 &#8230; <a href="http://www.caiyanpei.com/jquery-flip/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>前些天在实现一个网站的需求：1、展示一个分类里边的条目；2、默认显示前十条，并显示一个展开按钮，点击展开按钮，点击后下拉显示该分类下所有条目；3、展开后，按钮变为收起按钮，点击收起恢复为默认显示条目。</p>
<p>试图想用jquery的<a href="http://www.w3school.com.cn/jquery/effect_slidetoggle.asp">slideToggle()</a>、<a href="http://www.w3school.com.cn/jquery/effect_animate.asp">animate()</a>函数实现，发现行不通，处理不了剩余内容的展开收起。后来想到通过联系展开按钮的class与主题内容的id匹配，在按钮的click事件里通过修改css和jquery的<a href="http://www.w3school.com.cn/jquery/effect_animate.asp">animate()</a>函数结合实现想要的效果，代码如下(这边显示一段文字，默认显示文字前面的一部分内容)：</p>
<p>jquery部分：</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;.more-btn&quot;).click(function(){
			 if($(&quot;#&quot;+this.parentNode.className).css(&quot;height&quot;)==&quot;100px&quot;){
			  	$(&quot;#&quot;+this.parentNode.className).css(&quot;height&quot;,&quot;auto&quot;);
			  	this.value=&quot;收起&quot;;
			  }
			 else{
			 	$(&quot;#&quot;+this.parentNode.className).animate({height:&quot;100px&quot;},&quot;slow&quot;);
			 	this.value=&quot;展开&quot;;
			 	}
		  });
</pre>
<p>css部分：</p>
<pre class="brush: css; title: ; notranslate">
body {
			margin:0;
			padding:40px 40px;
			background:#fff;
			font:Arial, Helvetica, sans-serif;
			font-size:13px;
			line-height:180%;
		}
		.case{
			width:240px;
		}
		.entry{
			clear: both;
			line-height: 1.6em;
			width:223px;
			height:100px;
			overflow:hidden;
			line-height:18px;
			border-top:#ff9933 1px solid;
			border-left:#ff9933 1px solid;
			border-right:#ff9933 1px solid;
			padding-left:5px;
		}
		.more-btn{
			padding:0;
			width:230px;
			border-left:#ff9933 1px solid;
			border-right:#ff9933 1px solid;
			height:27px;
			background:#f4dc92;
			font-size:14px;
			font-weight:bolder;
			color:#000;
		}             
</pre>
<p>html代码：</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;demo&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div class=&quot;case&quot;&gt;    	
	&lt;div class=&quot;entry&quot; id=&quot;entry-1&quot;&gt;	
	      	显示的内容在此。。。
	&lt;/div&gt;&lt;!--entry--&gt;
	&lt;div class=&quot;entry-1&quot;&gt;&lt;input type=&quot;button&quot;  class=&quot;more-btn&quot; value=&quot;更多&quot; /&gt;&lt;/div&gt;	
	&lt;/div&gt; &lt;!--case--&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>demo：<a href="http://www.xiuchezu.com/wp-content/uploads/2010/09/demo.html">猛击此查看demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.caiyanpei.com/jquery-flip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>原创wordpress主题BlueShowyo发布</title>
		<link>http://www.caiyanpei.com/blueshowyo-theme-release/</link>
		<comments>http://www.caiyanpei.com/blueshowyo-theme-release/#comments</comments>
		<pubDate>Sun, 30 May 2010 15:56:51 +0000</pubDate>
		<dc:creator>tsai</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress主题]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://cyp.me/?p=149</guid>
		<description><![CDATA[终于实现了对自己的承诺，发布了第一个wordpress主题，将就把它叫做Blue &#8230; <a href="http://www.caiyanpei.com/blueshowyo-theme-release/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>终于实现了对自己的承诺，发布了第一个wordpress主题，将就把它叫做BlueShowyo,因为清一色蓝色调，晾出来勉励一下自己（配色方面还是要多学习了，争取做出像样点的主题），让自己能够一直学习下去，保持对设计方面的兴趣。整个主题的效果也就是我现在用的主题那样，个人觉得比较简单（但不清新），欢迎有兴趣试用的朋友批评，下载地址如下：</p>
<p><a title="BlueShowyo.zip" href="http://www.xiuchezu.com/wp-content/uploads/2010/05/BlueShowyo.zip">猛击此下载BlueShowyo Theme</a></p>
<p>github地址:<a href="https://github.com/lioneltsai/showyo_theme" target="_blank">Fork from github</a></p>
<p>发现问题请留言提出，谢谢。</p>
<p>话不多说，主题截图如下：</p>
<p><a href="http://www.xiuchezu.com/wp-content/uploads/2010/05/LocalhostWP.png"><img class="size-large wp-image-150 alignnone" title="BlueShowyo Theme" alt="" src="http://www.xiuchezu.com/wp-content/uploads/2010/05/LocalhostWP-709x1024.png" width="600" height="900" /></a></p>
<p>想预览大图请猛击以上图片。</p>
<p>查看Theme演示:<a href="http://demo.showyo.net/?themedemo=BlueShowyo">Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.caiyanpei.com/blueshowyo-theme-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
