<?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>IInterest</title>
	<atom:link href="http://www.iinterest.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iinterest.net</link>
	<description>Design &#38; Develope</description>
	<lastBuildDate>Thu, 29 Jul 2010 03:07:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CSS方法解决chrome 12像素字体限制</title>
		<link>http://www.iinterest.net/2010/07/14/css-chrome-12px/</link>
		<comments>http://www.iinterest.net/2010/07/14/css-chrome-12px/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 14:16:55 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=918</guid>
		<description><![CDATA[中文版的chrome有个12px字体限制的问题，就是当字体小于12px时候都以12px来显示，这个问题在中文网站中并不突出，因为中文字体为了显示清晰一般都定义为大于或等于12px，但如果是一些英文网站那就不好说了，这时12px的限制就会破坏页面的美感，甚至因为文字变大而导致页面变形。 网络上有一些解决方法，但都是针对本地客户端的修改，毕竟我们不能让每个用户去修改他的浏览器设置，所以还是希望通过css方法解决，通过不断尝试找到了一个偏方： 通过自制字体来解决12px限制。 方法的灵感来源于一次字体对比，当我在页面中载入Verdana和Georgia时，发现同样是12px，但在显示上Georgia比Verdana小，于是就想到如果能找到一种字体，它的12px比其它正常字体的12px要小许多，这样就算chrome有12px限制，那么这个字体因为自身12px小的缘故所以显示上就会明显小于其它字体的12px，也就间接的达到缩小字体的目的。但尝试了很多字体都没有找到合适的，所以最后决定自己修改一套字体。 这里用的是系统自带的arial，通过FontLab来修改，我只保留了A-Z、a-z、0-9以及一些运算符号，然后将它们的大小缩至原来的70%(反复测试结果，70%字体看上去比较正常=.=) 保存，重命名为arialg&#8230; 通过@font-face外链自定义字体 有了合适的字体，剩下的就是用@font-face加载它，修改后的arialg大小只有35kb，应该不会对页面载入造成负担。最后还可以通过webkit的hack来防止其他浏览器加载这个字体。 看看chrome中的效果: Demo: &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62; &#60;title&#62;temp&#60;/title&#62; &#60;style type=&#34;text/css&#34; media=&#34;all&#34;&#62; *{ margin:0; padding:0;} @media screen and (-webkit-min-device-pixel-ratio:0){@font-face { font-family:arialg; src: &#8230; <a href="http://www.iinterest.net/2010/07/14/css-chrome-12px/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>中文版的chrome有个12px字体限制的问题，就是当字体小于12px时候都以12px来显示，这个问题在中文网站中并不突出，因为中文字体为了显示清晰一般都定义为大于或等于12px，但如果是一些英文网站那就不好说了，这时12px的限制就会破坏页面的美感，甚至因为文字变大而导致页面变形。</p>
<p><a href="http://www.iinterest.net/wp-content/uploads/2010/07/chrome1.png"><img class="alignnone size-full wp-image-924" title="chrome" src="http://www.iinterest.net/wp-content/uploads/2010/07/chrome1.png" alt="" width="500" height="300" /></a><br />
<span id="more-918"></span><br />
网络上有一些解决方法，但都是针对本地客户端的修改，毕竟我们不能让每个用户去修改他的浏览器设置，所以还是希望通过css方法解决，通过不断尝试找到了一个偏方：</p>
<p><strong>通过自制字体来解决12px限制。</strong></p>
<p>方法的灵感来源于一次字体对比，当我在页面中载入Verdana和Georgia时，发现同样是12px，但在显示上Georgia比Verdana小，于是就想到如果能找到一种字体，它的12px比其它正常字体的12px要小许多，这样就算chrome有12px限制，那么这个字体因为自身12px小的缘故所以显示上就会明显小于其它字体的12px，也就间接的达到缩小字体的目的。但尝试了很多字体都没有找到合适的，所以最后决定自己修改一套字体。</p>
<p>这里用的是系统自带的arial，通过FontLab来修改，我只保留了A-Z、a-z、0-9以及一些运算符号，然后将它们的大小缩至原来的70%(反复测试结果，70%字体看上去比较正常=.=)<br />
<br/><br />
<a href="http://www.iinterest.net/wp-content/uploads/2010/07/fontlab.png"><img src="http://www.iinterest.net/wp-content/uploads/2010/07/fontlab.png" alt="" title="fontlab" width="500" height="347" class="alignnone size-full wp-image-937" /></a><br />
<br/><br />
保存，重命名为arialg&#8230;</p>
<p><strong>通过@font-face外链自定义字体</strong></p>
<p>有了合适的字体，剩下的就是用@font-face加载它，修改后的arialg大小只有35kb，应该不会对页面载入造成负担。最后还可以通过webkit的hack来防止其他浏览器加载这个字体。</p>
<p>看看chrome中的效果:</p>
<p><a href="http://www.iinterest.net/wp-content/uploads/2010/07/chrome2.png"><img class="alignnone size-full wp-image-926" title="chrome2" src="http://www.iinterest.net/wp-content/uploads/2010/07/chrome2.png" alt="" width="500" height="300" /></a></p>
<p><strong>Demo:</strong></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_wrGTPe">
&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;temp&lt;/title&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
*{ margin:0; padding:0;}
@media screen and (-webkit-min-device-pixel-ratio:0){@font-face { font-family:arialg; src: url(&quot;http://www.iinterest.net/demo/font/arialg.ttf&quot;);}}
div{ width:200px; height:30px; margin:10px; border:1px dotted #d7d7d7;}
@media screen and (-webkit-min-device-pixel-ratio:0){.i-font{ font-family:arialg; font-size:12px;}}
.f16{ font-size:16px;}
.f14{ font-size:14px;}
.f12{ font-size:12px;}
.f10{ font-size:10px;}
.f8{ font-size:8px;}
.f6{ font-size:6px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;i-font&quot;&gt;iinterest 0123456789&lt;/div&gt;
&lt;div class=&quot;f16&quot;&gt;iinterest font-size:16px&lt;/div&gt;
&lt;div class=&quot;f14&quot;&gt;iinterest font-size:14px&lt;/div&gt;
&lt;div class=&quot;f12&quot;&gt;iinterest font-size:12px&lt;/div&gt;
&lt;div class=&quot;f10&quot;&gt;iinterest font-size:10px&lt;/div&gt;
&lt;div class=&quot;f8&quot;&gt;iinterest font-size:8px&lt;/div&gt;
&lt;div class=&quot;f6&quot;&gt;iinterest font-size:6px&lt;/div&gt;
&lt;div style=&quot;font-family:Verdana; font-size:12px;&quot;&gt;Verdana font-size:12px&lt;/div&gt;
&lt;div style=&quot;font-family:Georgia; font-size:12px;&quot;&gt;Georgia font-size:12px&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_wrGTPe');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_wrGTPe');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><strong>当然这个方法也有明显的弊端：</strong><br />
1.对字体的要求比较高，想找到合适的字体不容易，自制的话成本又较高，而且很难保证美观。<br />
2.会影响到同样是webkit内核的safari浏览器。<br />
3.只适用于英文字体。</p>
<p>折腾出的这个方法也只能算是勉强能用，虽然涉及到字体制作，但主要原理还是利用CSS，而且不牵扯到用户设置，所以姑且算是一种CSS方法吧，呵呵。当然最终还是希望google能把这个蹩脚的限制去掉,能让我们有更多发挥的空间。</p>
<p>FontLab<br />
windows版本(可以去网上找下<a href="http://www.google.com/search?hl=zh-CN&#038;q=fontlab+%E7%BB%BF%E8%89%B2&#038;aq=f&#038;aqi=&#038;aql=&#038;oq=&#038;gs_rfai=" target="_blank">绿色版</a>)<br />
mac版本(带key)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/07/14/css-chrome-12px/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>mac下安装配置php环境以及WordPress</title>
		<link>http://www.iinterest.net/2010/07/01/mac-php-apache-mysql-wordpress/</link>
		<comments>http://www.iinterest.net/2010/07/01/mac-php-apache-mysql-wordpress/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 03:25:59 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=903</guid>
		<description><![CDATA[很久之前写过一篇介绍windows下配置PHP安装WordPress的文章&#8221;在本地安装 wordpress&#8220;,最近经常在mac上做开发,所以也想把WordPress搬过来,于是折腾就开始了: 1.配置PHP环境 这里用于配置PHP环境的软件仍然是XAMPP,首先下载XAMPP Mac OS X 1.7.3;然后安装到/Applications目录下;运行XAMPP,开启apache和mysql;最后在浏览器中输入http://localhost.如果出现下图所示的欢迎页面就说明成功了! 2.安装WordPress 新建数据库,在欢迎页面中点击&#8221;phpMyAdmin&#8221;进入数据库后台,具体的设置可以看看&#8221;在本地安装 wordpress&#8220;. 下载最新的WordPress3.0,然后将解压的文件放到&#8221;站点&#8221;文件夹下,最后在浏览器中输入http://localhost/~用户名/文件夹名 进行自动安装. 至此&#8221;又一个WordPress博客&#8221;就完成了. 如果只是安装一个WordPress那么现在就可以收工了,但我想把blog的数据也同步,于是折腾才刚刚开始&#8230; 说到WordPress同步数据,最先想到的自然是最常用的导入,导出工具,但这次它却很不给面子,导入过程中提示&#8221;已上传的文件无法被移动到&#8230;&#8220;检查XML的文件名和相关文件夹的权限都没发现问题,不想纠结,放弃&#8230;改用phpmyadmin导入数据. 进入phpmyadmin选择相应的数据库,点击导入数据,选择上传备份的sql文件 但这里却提示&#8221;#1062 &#8211; Duplicate entry &#8217;1&#8242; for key 1错误&#8230;&#8220;,没退路了&#8230;google一下,发现是主键重复造成的错误,可能是刚刚导入XML所致,于是清空所有表,再导入一次,成功! 原以为这就搞定了,但进入blog才发现由于导入的是线上的数据所以链接全是http://iinterest.net&#8230;再次进入数据库,打开&#8221;wp_options&#8220;表,将&#8221;siteurl&#8220;&#8221;home&#8220;的值改为&#8221;http://localhost/~用户名/文件夹名&#8220;,到这里才算全部搞定,历经2个小时&#8230;]]></description>
			<content:encoded><![CDATA[<p>很久之前写过一篇介绍windows下配置PHP安装WordPress的文章&#8221;<a href="http://www.iinterest.net/2008/12/11/setup_wordpress/" target="_blank">在本地安装 wordpress</a>&#8220;,最近经常在mac上做开发,所以也想把WordPress搬过来,于是折腾就开始了:</p>
<p><strong>1.配置PHP环境</strong></p>
<p>这里用于配置PHP环境的软件仍然是XAMPP,首先下载<a href="http://www.apachefriends.org/download.php?xampp-macosx-1.7.3.dmg">XAMPP Mac OS X 1.7.3</a>;然后安装到/Applications目录下;运行XAMPP,开启apache和mysql;最后在浏览器中输入<a href="http://localhost" target="_blank">http://localhost</a>.如果出现下图所示的欢迎页面就说明成功了!<br />
<span id="more-903"></span><br />
<a href="http://www.iinterest.net/wp-content/uploads/2010/07/mac-xampp1.jpg"><img class="alignnone size-full wp-image-909" title="mac-xampp" src="http://www.iinterest.net/wp-content/uploads/2010/07/mac-xampp1.jpg" alt="" width="500" height="281" /></a></p>
<p><strong>2.安装WordPress</strong></p>
<p>新建数据库,在欢迎页面中点击&#8221;phpMyAdmin&#8221;进入数据库后台,具体的设置可以看看&#8221;<a href="http://www.iinterest.net/2008/12/11/setup_wordpress/" target="_blank">在本地安装 wordpress</a>&#8220;.</p>
<p>下载最新的<a href="http://wordpress.org/" target="_blank">WordPress3.0</a>,然后将解压的文件放到&#8221;站点&#8221;文件夹下,最后在浏览器中输入http://localhost/~用户名/文件夹名 进行自动安装.</p>
<p><strong>至此&#8221;又一个WordPress博客&#8221;就完成了.</strong></p>
<p>如果只是安装一个WordPress那么现在就可以收工了,但我想把blog的数据也同步,于是折腾才刚刚开始&#8230;</p>
<p>说到WordPress同步数据,最先想到的自然是最常用的导入,导出工具,但这次它却很不给面子,导入过程中提示&#8221;<span style="color: #ff6600;">已上传的文件无法被移动到&#8230;</span>&#8220;检查XML的文件名和相关文件夹的权限都没发现问题,不想纠结,放弃&#8230;改用phpmyadmin导入数据.</p>
<p>进入phpmyadmin选择相应的数据库,点击导入数据,选择上传备份的sql文件</p>
<p><a href="http://www.iinterest.net/wp-content/uploads/2010/07/sql.jpg"><img class="alignnone size-full wp-image-913" title="sql" src="http://www.iinterest.net/wp-content/uploads/2010/07/sql.jpg" alt="" width="500" height="160" /></a></p>
<p>但这里却提示&#8221;<span style="color: #ff6600;">#1062 &#8211; Duplicate entry &#8217;1&#8242; for key 1错误&#8230;</span>&#8220;,没退路了&#8230;google一下,发现是主键重复造成的错误,可能是刚刚导入XML所致,于是清空所有表,再导入一次,成功!</p>
<p>原以为这就搞定了,但进入blog才发现由于导入的是线上的数据所以链接全是http://iinterest.net&#8230;再次进入数据库,打开&#8221;<span style="color: #008000;">wp_options</span>&#8220;表,将&#8221;<span style="color: #008000;">siteurl</span>&#8220;&#8221;<span style="color: #008000;">home</span>&#8220;的值改为&#8221;<span style="color: #008000;">http://localhost/~用户名/文件夹名</span>&#8220;,到这里才算全部搞定,历经2个小时&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/07/01/mac-php-apache-mysql-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[转]如何为 iPad 打造速度超快的 HTML5 软件</title>
		<link>http://www.iinterest.net/2010/06/23/how-to-make-really-fast-html5-app-for-ipad/</link>
		<comments>http://www.iinterest.net/2010/06/23/how-to-make-really-fast-html5-app-for-ipad/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 05:35:24 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=889</guid>
		<description><![CDATA[有一个为 iPad 设计的用来查时区的 HTML5 软件 everytimezone.com 最近引起了一些注意。它简单、到位，可以离线使用，并且速度极快。由于 HTML5 软件本质上只是一个网页，故不需要通过苹果的 App Store 商店发行，用户只要用 iPad 访问 everytimezone.com，然后将书签存到桌面，下一次打开就变成了一个与原生软件几乎无异的东西。everytimezone.com 的作者托马斯·富赫是资深 JavaScript 专家，也是 JavaScript 框架 Prototype 的核心开发者之一。他近日在博客上撰文传授了如何保证 HTML5 软件在 iPad 上飞速运行的七条秘诀，特翻译如下。—— 编者 一、少用图片 一开始，为了做出用来表示各个城市的每一天的那种渐变效果，我们用了一套相当复杂的 -webkit-gradient，结果发现这会令转译速度变得非常非常慢。-webkit-gradient 的工作方法是构建位图，对于浏览器的转译引擎来说，这和从外部加载图片（例如一张 PNG）是完全一样的。MobileSafari 显示图片速度之慢是出了名的（希望 4.0 对此有所改进），要解决这个问题，基本上只能不用图片和 -webkit-gradient。 我们最终把那些色彩条快用背景上的一个很大的 canvas 元素替代了。当你拖动游标线时，那些条块的颜色会发生变化，只有正在变化的部分才会被重新绘制。用 canvas &#8230; <a href="http://www.iinterest.net/2010/06/23/how-to-make-really-fast-html5-app-for-ipad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>有一个为 iPad 设计的用来查时区的 HTML5 软件 everytimezone.com 最近引起了一些注意。它简单、到位，可以离线使用，并且速度极快。由于 HTML5 软件本质上只是一个网页，故不需要通过苹果的 App Store 商店发行，用户只要用 iPad 访问 everytimezone.com，然后将书签存到桌面，下一次打开就变成了一个与原生软件几乎无异的东西。everytimezone.com 的作者托马斯·富赫是资深 JavaScript 专家，也是 JavaScript 框架 Prototype 的核心开发者之一。他近日在博客上撰文传授了如何保证 HTML5 软件在 iPad 上飞速运行的七条秘诀，特翻译如下。—— 编者</p>
<p><strong>一、少用图片</strong></p>
<p>一开始，为了做出用来表示各个城市的每一天的那种渐变效果，我们用了一套相当复杂的 -webkit-gradient，结果发现这会令转译速度变得非常非常慢。-webkit-gradient 的工作方法是构建位图，对于浏览器的转译引擎来说，这和从外部加载图片（例如一张 PNG）是完全一样的。MobileSafari 显示图片速度之慢是出了名的（希望 4.0 对此有所改进），要解决这个问题，基本上只能不用图片和 -webkit-gradient。<br />
<span id="more-889"></span><br />
我们最终把那些色彩条快用背景上的一个很大的 canvas 元素替代了。当你拖动游标线时，那些条块的颜色会发生变化，只有正在变化的部分才会被重新绘制。用 canvas 时可以在某种程度上复用 -webkit-gradient，比如这样：</p>
<blockquote>
<div id="_mcePaste">// WebKit CSS gradient</div>
<div id="_mcePaste">-webkit-gradient(linear, left top, right top,</div>
<div id="_mcePaste">from(#4b4c4d),</div>
<div id="_mcePaste">color-stop(0.249, #4b4c4d),</div>
<div id="_mcePaste">color-stop(0.25, #575b5c),</div>
<div id="_mcePaste">color-stop(0.329, #575b5c),</div>
<div id="_mcePaste">color-stop(0.33, #6b7071),</div>
<div id="_mcePaste">color-stop(0.749, #6b7071),</div>
<div id="_mcePaste">color-stop(0.75, #575b5c),</div>
<div id="_mcePaste">color-stop(0.909, #575b5c),</div>
<div id="_mcePaste">color-stop(0.91, #4b4c4d),</div>
<div id="_mcePaste">to(#4b4c4d)</div>
<div id="_mcePaste">);</div>
<div id="_mcePaste">// canvas gradient</div>
<div id="_mcePaste">var gradient = $(&#8216;canvas&#8217;).getContext(&#8220;2d&#8221;).createLinearGradient(0,0,230,0);</div>
<div id="_mcePaste">gradient.addColorStop(0,&#8217;#4b4c4d&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.249,&#8217;#4b4c4d&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.25,&#8217;#575b5c&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.329,&#8217;#575b5c&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.33,&#8217;#6b7071&#8242;);</div>
<div id="_mcePaste">gradient.addColorStop(0.749,&#8217;#6b7071&#8242;);</div>
<div id="_mcePaste">gradient.addColorStop(0.75,&#8217;#575b5c&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.909,&#8217;#575b5c&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(0.91,&#8217;#4b4c4d&#8217;);</div>
<div id="_mcePaste">gradient.addColorStop(1,&#8217;#4b4c4d&#8217;);</div>
</blockquote>
<p><br/><br />
<strong>二、不要用 text-shadow 和 box-shadow</strong></p>
<p>这是速度变慢的另外一个重要因素。最好不要用这些 CSS 属性。</p>
<p><strong>三、硬件加速是很新的功能……而且也很多BUG</strong></p>
<p>在 Safari 上，只要使用 -webkit-transform 这个 CSS 属性就可以启用硬件加速了。（opacity 也行，不过缺点上面说过了。）</p>
<p>硬件加速有其局限，例如同时运行的动画数量是有限制的，如果超过了这个限制，动画就会闪烁，有时还会出错。不过如果轻度使用的话，效果会非常棒。</p>
<p><strong>四、尽可能地使用触控事件</strong></p>
<p>触控事件是个好选择，因为传统的 onClick 事件在 iPad 上用来会有点延迟。在 everytimezone.com 的源代码里有些小窍门，教你如何在使用触控事件的同时，也能够支持非触控设备上的浏览器：</p>
<blockquote><p>var supportsTouch = &#8216;createTouch&#8217; in document;<br />
element[supportsTouch ? 'ontouchmove' : 'onmousemove'] = function(event){<br />
var pageX = event.pageX;<br />
if (event.touches) pageX = event.touches[0].pageX;<br />
// &#8230;<br />
}</p></blockquote>
<p><strong>五、不要用 opacity</strong></p>
<p>因为某些原因，使用 opacity 这个 CSS 属性有时会干扰硬件加速。如果你感到速度变慢，但又看不出哪里出了问题的话，就检查一下有没有用到 opacity 吧。</p>
<p><strong>六、万事无捷径，请手写 JavaScript 和 CSS</strong></p>
<p>不要依赖框架或是网页标准狂热分子推荐给你的东西。我们这个例子里只有一个高度精简的 HTML 页面，CSS 都写在页面里，没用任何 JavaScript 框架，并尽量利用了目标平台（iPad）的特性，最终的结果就是一个几乎能够瞬间加载的苗条网页，而且缓存做得很好，离线使用也毫不失礼。没错，我们也可以选择用 JavaScript 和 CSS 框架，但有的时候少即多。（记住，各类框架所提供的那些对跨浏览器的支持你并非全都需要。）</p>
<blockquote><p>// mini-pico-tiny convenience micro-framework, ymmv<br />
function $(id){ return document.getElementById(id); }<br />
function html(id, html){ $(id).innerHTML = html; }<br />
function css(id, style){ $(id).style.cssText += &#8216;;&#8217;+style; }<br />
function anim(id, transform, opacity, dur){<br />
css(id, &#8216;-webkit-transition:-webkit-transform&#8217;+',opacity &#8216;+(dur||0.5)+&#8217;s,&#8217;+(dur||0.5)+&#8217;s;-webkit-transform:&#8217;+transform+&#8217;;opacity:&#8217;+(1||opacity));<br />
}</p></blockquote>
<p><strong>七、别用 translate，用 translate3d</strong></p>
<p>使用 -webkit-transform 时，记得用 translate3d(x,y,z) 语法，而不是 translate(x,y)。因为某种原因，后者无法支持硬件加速，至少在 iOS 3.x 上不行（不过在桌面版 Safari 里似乎没问题）。谢谢马提奥·斯宾内利指出这点。（也推荐大家看看他做的<a href="http://cubiq.org/iscroll" target="_blank"> iScroll</a>，里面有很多很棒的代码，也是演示如何为页面在移动版 WebKit 上的速度进行优化的好例子。）</p>
<p>转自<a href="https://apple4.us/2010/06/how-to-make-really-fast-html5-app-for-ipad.html" target="_blank">apple4.us</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/06/23/how-to-make-really-fast-html5-app-for-ipad/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery图片放大预览插件 cloud-zoom</title>
		<link>http://www.iinterest.net/2010/06/11/jquery-image-zoom-cloud-zoom/</link>
		<comments>http://www.iinterest.net/2010/06/11/jquery-image-zoom-cloud-zoom/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 08:27:03 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=877</guid>
		<description><![CDATA[table {
	
	border-collapse:collapse;
	border:1px solid #CCC;
	margin-bottom:20px;
}
td , th{
	padding:10px;
	vertical-align:top;	
	border:1px dotted #CCC;
}
th {
	background-color:#eee;	
}
td.noWrap {
	white-space:nowrap;	
} <a href="http://www.iinterest.net/2010/06/11/jquery-image-zoom-cloud-zoom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iinterest.net/wp-content/uploads/2010/06/cloud-zoom.jpg"><img class="alignnone size-full wp-image-878" title="cloud-zoom" src="http://www.iinterest.net/wp-content/uploads/2010/06/cloud-zoom.jpg" alt="" width="514" height="257" /></a></p>
<p>分享一个jquery的图片放大预览插件:cloud-zoom.</p>
<p><a href="http://www.iinterest.net/demo/cloud-zoom.html" target="_blank"><strong>cloud-zoom DEMO</strong></a></p>
<p>部署步骤:</p>
<p>1.加载jquery-1.4.js 和 cloud-zoom.1.0.2.min.js</p>
<p>2.加入样式表(DEMO中&lt;style&gt;部分)</p>
<p>3.为需要放大预览效果的缩略图添加超链接<span style="color: #888888;">&lt;a&gt;</span>并将类命名为&#8221;cloud-zoom&#8221; <span style="color: #888888;">class=&#8221;cloud-zoom&#8221;</span></p>
<p>4.在超链接<span style="color: #888888;">&lt;a&gt;</span>的rel属性中加入需要的参数实现不同的效果<br />
<span id="more-877"></span><br />
实例:</p>
<blockquote><p>&lt;a href=&#8221;images/大图.jpg&#8221; class=&#8221;cloud-zoom&#8221; rel=&#8221;position:&#8217;inside&#8217; ,showTitle:false, adjustX:-2, adjustY:-2&#8243;&gt;&lt;img src=&#8221;images/缩略图.jpg&#8221; title=&#8221;iinterest&#8221; /&gt;&lt;/a&gt;</p></blockquote>
<p>cloud-zoom参数说明:</p>
<table border="1" cellpadding="2" width="100%">
<tbody>
<tr>
<th>Parameter</th>
<th>Description (from V1.0.0)</th>
<th>Default Value</th>
</tr>
<tr>
<td>zoomWidth</td>
<td>The width of the zoom window in pixels. If &#8216;auto&#8217; is specified, the width will be the same as the small image.</td>
<td class="noWrap">&#8216;auto&#8217;</td>
</tr>
<tr>
<td>zoomHeight</td>
<td>The height of the zoom window in pixels. If &#8216;auto&#8217; is specified, the height will be the same as the small image.</td>
<td><span class="noWrap">&#8216;auto&#8217;</span></td>
</tr>
<tr>
<td>position</td>
<td>Specifies the position of the zoom window relative to the small image. Allowable values are &#8216;left&#8217;, &#8216;right&#8217;, &#8216;top&#8217;, &#8216;bottom&#8217;, &#8216;inside&#8217; or you can specifiy the id of an html element to place the zoom window in e.g. position: &#8216;element1&#8242;</td>
<td>&#8216;right&#8217;</td>
</tr>
<tr>
<td>adjustX</td>
<td>Allows you to fine tune the x-position of the zoom window in pixels.</td>
<td>0</td>
</tr>
<tr>
<td>adjustY</td>
<td>Allows you to fine tune the y-position of the zoom window in pixels.</td>
<td>0</td>
</tr>
<tr>
<td>tint</td>
<td>Specifies a tint colour which will cover the small image. Colours should be specified in hex format, e.g. &#8216;#aa00aa&#8217;. Does not work with softFocus.</td>
<td>false</td>
</tr>
<tr>
<td>tintOpacity</td>
<td>Opacity of the tint, where 0 is fully transparent, and 1 is fully opaque.</td>
<td class="noWrap">0.5</td>
</tr>
<tr>
<td>lensOpacity</td>
<td>Opacity of the lens mouse pointer, where 0 is fully transparent, and 1 is fully opaque. In tint and soft-focus modes, it will always be transparent.</td>
<td>0.5</td>
</tr>
<tr>
<td>softFocus</td>
<td>Applies a subtle blur effect to the small image. Set to true or false. Does not work with tint.</td>
<td>false</td>
</tr>
<tr>
<td>smoothMove</td>
<td>Amount of smoothness/drift of the zoom image as it moves. The higher the number, the smoother/more drifty the movement will be. 1 = no smoothing.</td>
<td>3</td>
</tr>
<tr>
<td>showTitle</td>
<td>Shows the title tag of the image. True or false.</td>
<td>true</td>
</tr>
<tr>
<td>titleOpacity</td>
<td>Specifies the opacity of the title if displayed,  where 0 is fully transparent, and 1 is fully opaque.</td>
<td>0.5</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/06/11/jquery-image-zoom-cloud-zoom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让IE支持HTML5标签</title>
		<link>http://www.iinterest.net/2010/05/29/ie-html5-tag/</link>
		<comments>http://www.iinterest.net/2010/05/29/ie-html5-tag/#comments</comments>
		<pubDate>Sat, 29 May 2010 09:20:03 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=864</guid>
		<description><![CDATA[HTML5的特性之一就是新增了语义的标签,比如 header, nav,section,aside, footer,audio,canvas等等.这些标签为设计者提供了更为灵活高效的布局方式.可惜目前的IE是不支持这些标签的&#8230;不过还是可以通过一些手段让IE支持部分标签. 先来看看一个HTML5的布局,由于IE无法识别新的语义化标签,所以样式表并没有起作用. &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34; /&#62; &#60;title&#62;HTML5 Lab - iinterest&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; #wrapper{ width:600px; margin:0 auto;} header{ width:100%; height:100px; background:#C2E0EE;} article{ float:left; width:60%; height:300px; background:#8EC1DA;} section{ margin:20px; background:#FFF;} aside{ float:right; width:40%; height:300px; &#8230; <a href="http://www.iinterest.net/2010/05/29/ie-html5-tag/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>HTML5的特性之一就是新增了语义的标签,比如 header, nav,section,aside, footer,audio,canvas等等.这些标签为设计者提供了更为灵活高效的布局方式.可惜目前的IE是不支持这些标签的&#8230;不过还是可以通过一些手段让IE支持部分标签.</p>
<p>先来看看一个HTML5的布局,由于IE无法识别新的语义化标签,所以样式表并没有起作用.<br />
<span id="more-864"></span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_oEGK9c">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;HTML5 Lab - iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
#wrapper{ width:600px; margin:0 auto;}
header{ width:100%; height:100px; background:#C2E0EE;}
article{ float:left; width:60%; height:300px; background:#8EC1DA;}
	section{ margin:20px; background:#FFF;}
aside{ float:right; width:40%; height:300px; background:#688B9A;}
footer{ width:100%; height:100px; background:#CCC; clear:both;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrapper&quot;&gt;
	&lt;header&gt;header&lt;/header&gt;
    &lt;article&gt;
    	&lt;section&gt;section&lt;/section&gt;
    &lt;/article&gt;
    &lt;aside&gt;aside&lt;/aside&gt;
    &lt;footer&gt;footer&lt;/footer&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_oEGK9c');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_oEGK9c');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>解决的方法就是用js来创建HTML5中新增的标签,因为此代码只提供给IE,所以加上条件注释:</p>
<blockquote>
<div id="_mcePaste">&lt;!&#8211;[if IE]&gt;</div>
<div id="_mcePaste">&lt;script&gt;</div>
<div id="_mcePaste">(function(){if(!/*@cc_on!@*/0)return;var e = &#8220;abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header, hgroup,mark,menu,meter,nav,output,progress,section,time,video&#8221;.split(&#8216;,&#8217;),i=e.length;while(i&#8211;){document.createElement(e[i])}})()</div>
<div id="_mcePaste">&lt;/script&gt;</div>
<div id="_mcePaste">&lt;![endif]&#8211;&gt;</div>
</blockquote>
<p>这时可以看到例子中的样式表生效了,但布局效果却并不是预想的那样(可以对比支持HTML5的浏览器),原因就在于js所创建的元素默认都为行内元素&#8230;</p>
<p>所以最后还要为那些结构性的块级标签加上一个样式:</p>
<blockquote><p>article, aside, dialog, footer, header, section, footer, nav, figure {<br />
display: block;<br />
}</p></blockquote>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_T4ujpW">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;HTML5 Lab - iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
#wrapper{ width:600px; margin:0 auto;}
header{ width:100%; height:100px; background:#C2E0EE;}
article{ float:left; width:60%; height:300px; background:#8EC1DA;}
	section{ margin:20px; background:#FFF;}
aside{ float:right; width:40%; height:300px; background:#688B9A;}
footer{ width:100%; height:100px; background:#CCC; clear:both;}
&lt;/style&gt;
&lt;!--[if IE]&gt;
&lt;script&gt;
(function(){if(!/*@cc_on!@*/0)return;var e = &quot;abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video&quot;.split(','),i=e.length;while(i--){document.createElement(e[i])}})()
&lt;/script&gt;
&lt;style&gt;
article, aside, dialog, footer, header, section, footer, nav, figure {display: block;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrapper&quot;&gt;
	&lt;header&gt;header&lt;/header&gt;
    &lt;article&gt;
    	&lt;section&gt;section&lt;/section&gt;
    &lt;/article&gt;
    &lt;aside&gt;aside&lt;/aside&gt;
    &lt;footer&gt;footer&lt;/footer&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_T4ujpW');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_T4ujpW');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>至此IE就可以正常的显示所定义的标签了,但也仅仅是正常显示,类似audio,canvas这些多媒体以及交互式标签的功能是无法实现的.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/05/29/ie-html5-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
