<?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>UECSS.COM &#187; wap</title>
	<atom:link href="http://uecss.com/tag/wap/feed" rel="self" type="application/rss+xml" />
	<link>http://uecss.com</link>
	<description>专注前端开发，关注用户体验，记录成长历程</description>
	<lastBuildDate>Thu, 12 Jan 2012 02:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>(X)HTML Strict 下的嵌套规则</title>
		<link>http://uecss.com/x-html-strict-rules-under-the-nested.html</link>
		<comments>http://uecss.com/x-html-strict-rules-under-the-nested.html#comments</comments>
		<pubDate>Mon, 25 Apr 2011 02:06:35 +0000</pubDate>
		<dc:creator>猪的明天</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[wap]]></category>

		<guid isPermaLink="false">http://uecss.com/?p=1373</guid>
		<description><![CDATA[周末在搜寻有关IPTV的前端资源，真心的少（国内的），三屛的需要手机端的资源顺路带过来，之前仅有过两个WAP站点的工作经验，对于《(X)HTML Strict 下的嵌套规则》记录收藏如下： ＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝ 下面是一份在 HTML 4 Strict 和 XHTML 1.0 Strict 下必须遵守的标签嵌套规则，比如你不能在 &#60;a&#62; 里面再嵌入一个 &#60;a&#62; 这样的约定。 说明： 为了方便读者阅读，本文中的标签使用了大写（根据 XHTML 的规则，元素名必须小写，比如 &#60;html&#62; 而不应是 &#60;HTML&#62;） 小写的单词表明一组或一系列 HTML 标签 每一项条目（标签）后都跟随一组标签列表，如果没有这个列表，那么表明该条目（标签）内部不允许包含任何标签。这意味着该条目内部只能包含纯文本内容（#PCDATA，见下文）。如果注明 (empty)，这意味着该条目内部不允许包含任何形式的内容。对于 flow，inline，block，OBJECT 和 BODY，其内部允许包含的内容在文中会单独给出。 #PCDATA 的意思是“parsed character data”，即纯文本内容（不包括任何 HTML 标签，但是转义内容可以存在，比如 &#38;auml;和 &#38;#228;） CDATA 的意思是“character data”，这意味着不包括转义内容的纯文本内容，详细内容可以参考CDATA Confusion excluding &#8230; 意即不得直接或者间接的包含所列的元素 注1. 以上内容基于 [HTML 4.01 Specification] 的 Strict DTD。JunChen 翻译自 Allowed nesting of elements in HTML 4 [...]]]></description>
			<content:encoded><![CDATA[<p>周末在搜寻有关IPTV的前端资源，真心的少（国内的），三屛的需要手机端的资源顺路带过来，之前仅有过两个WAP站点的工作经验，对于《(X)HTML Strict 下的嵌套规则》记录收藏如下：<span id="more-1373"></span></p>
<p>＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝</p>
<p>下面是一份在 HTML 4 Strict 和 XHTML 1.0 Strict 下必须遵守的标签嵌套规则，比如你不能在 <code>&lt;a&gt;</code> 里面再嵌入一个 <code>&lt;a&gt;</code> 这样的约定。</p>
<p><strong>说明：</strong></p>
<ul>
<li>为了方便读者阅读，本文中的标签使用了大写（根据 XHTML 的规则，元素名必须小写，比如 <code>&lt;html&gt;</code> 而不应是 <code>&lt;HTML&gt;</code>）</li>
<li>小写的单词表明一组或一系列 HTML 标签</li>
<li>每一项条目（标签）后都跟随一组标签列表，如果没有这个列表，那么表明该条目（标签）内部不允许包含任何标签。这意味着该条目内部只能包含纯文本内容（#PCDATA，见下文）。如果注明 (empty)，这意味着该条目内部不允许包含任何形式的内容。对于 flow，inline，block，OBJECT 和 BODY，其内部允许包含的内容在文中会单独给出。</li>
<li><a href="http://www.webreference.com/dlab/books/html/3-5.html#3-5-2-2">#PCDATA</a> 的意思是“parsed character data”，即纯文本内容（不包括任何 HTML 标签，但是转义内容可以存在，比如 <code>&amp;auml;</code>和 <code>&amp;#228;</code>）</li>
<li>CDATA 的意思是“character data”，这意味着不包括转义内容的纯文本内容，详细内容可以参考<a href="http://www.flightlab.com/~joe/sgml/cdata.html">CDATA Confusion</a></li>
<li>excluding &#8230; 意即不得直接或者间接的包含所列的元素</li>
</ul>
<p><a href="http://uecss.com/wp-content/uploads/2011/04/allowednesting.gif"><img class="aligncenter size-full wp-image-1374" title="(X)HTML Strict 下的嵌套规则" src="http://uecss.com/wp-content/uploads/2011/04/allowednesting.gif" alt="" width="546" height="1370" /></a></p>
<p>注1. 以上内容基于 [HTML 4.01 Specification] 的 <a href="http://www.w3.org/TR/1999/REC-html401-19991224/sgml/dtd.html">Strict DTD</a>。<a href="http://www.junchenwu.com/">JunChen</a> 翻译自 <a href="http://www.cs.tut.fi/~jkorpela/html/strict.html">Allowed nesting of elements in HTML 4 Strict (and XHTML 1.0 Strict)</a></p>
<p>注2. 对于 <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a>，基本上一致，不同点如下：</p>
<ul>
<li>对于 <code>&lt;script&gt;</code> 和 <code>&lt;style&gt;</code> 的内容，在 HTML 4 里是 <code>CDATA</code> 而在 XHTML 里是 <code>#PCDATA</code></li>
<li>在 XHTML 中，<code>&lt;table&gt;</code> 标签后可以紧跟一个 <code>&lt;tr&gt;</code>，而在 HTML 4.01 里，不允许这样，不过 <code>&lt;tbody&gt;</code> 标签又是可以省略的。意思就是说，如果代码中的 <code>&lt;table&gt;</code> 后紧跟 <code>&lt;tr&gt;</code>，对于 HTML 4.01，会隐性的生成一个 <code>&lt;tbody&gt;</code> 标签，而在 XHTML 里面就没有。这会影响到样式表使用 <code>tbody</code> 作为选择器。</li>
</ul>
<p>源：<a href="http://www.junchenwu.com/2007/01/allowed_nesting_of_elements_in_html_4_strict_and_xhtml_10_strict.html">http://www.junchenwu.com/2007/01/allowed_nesting_of_elements_in_html_4_strict_and_xhtml_10_strict.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uecss.com/x-html-strict-rules-under-the-nested.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iphone/ipad网站开发技巧整理</title>
		<link>http://uecss.com/iphone-ipad-web-development-skills.html</link>
		<comments>http://uecss.com/iphone-ipad-web-development-skills.html#comments</comments>
		<pubDate>Sun, 06 Jun 2010 04:57:55 +0000</pubDate>
		<dc:creator>猪的明天</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[iphone/ipad]]></category>
		<category><![CDATA[wap]]></category>

		<guid isPermaLink="false">http://uecss.com/?p=518</guid>
		<description><![CDATA[iphone/ipad异常刚猛，在此把收集到的一些开发技巧罗列出来,方便项目中参考使用,如下： 侦测iPhone/iPod 开发特定设备的移动网站，首先要做的就是设备侦测了。下面是使用Javascript侦测iPhone/iPod的UA，然后转向到专属的URL。 if&#40;&#40;navigator.userAgent.match&#40;/iPhone/i&#41;&#41; &#124;&#124; &#40;navigator.userAgent.match&#40;/iPod/i&#41;&#41;&#41; &#123; if &#40;document.cookie.indexOf&#40;&#34;iphone_redirect=false&#34;&#41; == -1&#41; &#123; window.location = &#34;http://m.example.com&#34;; &#125; &#125; 虽然Javascript是可以在水果设备上运行的，但是用户还是可以禁用。它也会造成客户端刷新和额外的数据传输，所以下面是服务器端侦测和转向： if&#40;strstr&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,'iPhone'&#41; &#124;&#124; strstr&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,'iPod'&#41;&#41; &#123; header&#40;'Location: http://yoursite.com/iphone'&#41;; exit&#40;&#41;; &#125; 设置viewpoint和屏幕等宽 如果不设置viewpoint，网站在viewpoint就会显示成缩略形式。如果你专门为iPhone/iPod开发网站，这一条很有用，而且很简单，只需要插入到head里就可以： &#60;meta name=&#34;viewport&#34; content=&#34;width=device-width; initial-scale=1.0; maximum-scale=1.0;&#34;&#62; 使用iPhone规格图标 如果你的用户将你的网站添加到home screen，iPhone会使用网站的缩略图作为图标。然而你可以提供一个自己设计的图标，这样当然更好。图片是57×57大小，png格式。不需要自己做圆角和反光，系统会自动完成这些工作。然后将下面这条加入head中： &#60;rel=&#34;apple-touch-icon&#34; href=&#34;images/youricon.png&#34;/&#62; 阻止旋转屏幕时自动调整字体大小 -webkit-text-size-adjust是webkit的私有css： html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 &#123;-webkit-text-size-adjust:none;&#125; 侦测设备旋转方向 iPhone可以在横屏状态下浏览网页，有时候你会想知道用户设备的手持状态来增强可用性和功能。下面一段Javascript可以判断出设备向哪个方向旋转，并且替换css： [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://uecss.com/wp-content/uploads/2010/06/apple-iphone-ipad-300x274.jpg"><img src="http://uecss.com/wp-content/uploads/2010/06/apple-iphone-ipad-300x274.jpg" alt="" title="apple-iphone-ipad" width="300" height="274" class="aligncenter size-full wp-image-528" /></a><br />
<b>iphone/ipad</b>异常刚猛，在此把收集到的一些开发技巧罗列出来,方便项目中参考使用,如下：</p>
<p><strong>侦测iPhone/iPod</strong></p>
<p>开发特定设备的移动网站，首先要做的就是设备侦测了。下面是使用Javascript侦测iPhone/iPod的UA，然后转向到专属的URL。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPhone/i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPod/i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;iphone_redirect=false&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
window.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://m.example.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>虽然Javascript是可以在水果设备上运行的，但是用户还是可以禁用。它也会造成客户端刷新和额外的数据传输，所以下面是服务器端侦测和转向：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>strstr<span style="color: #009900;">&#40;</span>$_SERVER<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'iPhone'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> strstr<span style="color: #009900;">&#40;</span>$_SERVER<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'iPod'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
header<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Location: http://yoursite.com/iphone'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
exit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>设置viewpoint和屏幕等宽</strong></p>
<p>如果不设置viewpoint，网站在viewpoint就会显示成缩略形式。如果你专门为iPhone/iPod开发网站，这一条很有用，而且很简单，只需要插入到head里就可以：<span id="more-518"></span></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0; maximum-scale=1.0;&quot;&gt;</pre></div></div>

<p><strong>使用iPhone规格图标</strong></p>
<p>如果你的用户将你的网站添加到home screen，iPhone会使用网站的缩略图作为图标。然而你可以提供一个自己设计的图标，这样当然更好。图片是57×57大小，png格式。不需要自己做圆角和反光，系统会自动完成这些工作。然后将下面这条加入head中：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;rel=&quot;apple-touch-icon&quot; href=&quot;images/youricon.png&quot;/&gt;</pre></div></div>

<p><strong>阻止旋转屏幕时自动调整字体大小</strong></p>
<p>-webkit-text-size-adjust是webkit的私有css：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html<span style="color: #00AA00;">,</span> body<span style="color: #00AA00;">,</span> form<span style="color: #00AA00;">,</span> fieldset<span style="color: #00AA00;">,</span> p<span style="color: #00AA00;">,</span> div<span style="color: #00AA00;">,</span> h1<span style="color: #00AA00;">,</span> h2<span style="color: #00AA00;">,</span> h3<span style="color: #00AA00;">,</span> h4<span style="color: #00AA00;">,</span> h5<span style="color: #00AA00;">,</span> h6 <span style="color: #00AA00;">&#123;</span>-webkit-text-size-adjust<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>侦测设备旋转方向</strong></p>
<p>iPhone可以在横屏状态下浏览网页，有时候你会想知道用户设备的手持状态来增强可用性和功能。下面一段Javascript可以判断出设备向哪个方向旋转，并且替换css：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> initialLoad<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>updateOrientation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> updateOrientation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> contentType <span style="color: #339933;">=</span> “show_”<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">orientation</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">:</span>
contentType <span style="color: #339933;">+=</span> “normal”<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90</span><span style="color: #339933;">:</span>
contentType <span style="color: #339933;">+=</span> “right”<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">90</span><span style="color: #339933;">:</span>
contentType <span style="color: #339933;">+=</span> “left”<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">180</span><span style="color: #339933;">:</span>
contentType <span style="color: #339933;">+=</span> “flipped”<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>“page_wrapper”<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span>“<span style="color: #003366; font-weight: bold;">class</span>”<span style="color: #339933;">,</span> contentType<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>iPhone才识别的CSS</strong></p>
<p>如果不想设备侦测，可以用CSS媒体查询来专为iPhone/iPod定义样式。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (max-device-width: 480px) {}</span></pre></div></div>

<p><strong>缩小图片</strong></p>
<p>网站的大图通常宽度都超过480像素，如果用前面的代码限制了缩放，这些图片在iPhone版显示显然会超过屏幕。好在iPhone机能还够，我们可以用CSS让iPhone自动将大图片缩小显示。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (max-device-width: 480px){</span>
img<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">max-width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>注意如果原图片非常大，或一个页面非常多图，最好还是在服务器端缩放到480像素宽，iPhone只需要在正常浏览时缩略到320像素。这样不会消耗太多流量和机能。</p>
<p><strong>默认隐藏工具栏</strong></p>
<p>iPhone的浏览器工具栏会在页面最顶端，卷动网页后才隐藏。这样在加载网页完成后显得很浪费空间，特别是横向屏幕时。我们可以让它自动卷动上去。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
setTimeout<span style="color: #009900;">&#40;</span>scrollTo<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>使用特殊链接</strong></p>
<p>这两条不用说了吧：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;tel:12345654321&quot;&gt;打电话给我&lt;/a&gt;
&lt;a href=&quot;sms:12345654321&quot;&gt;发短信&lt;/a&gt;</pre></div></div>

<p><strong>模拟:hover伪类</strong></p>
<p>因为iPhone并没有鼠标指针，所以没有hover事件。那么CSS :hover伪类就没用了。但是iPhone有Touch事件，onTouchStart 类似 onMouseOver，onTouchEnd 类似 onMouseOut。所以我们可以用它来模拟hover。使用Javascript：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myLinks <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> myLinks.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
myLinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>’touchstart’<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> “hover”<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
myLinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>’touchend’<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> “”<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>然后用CSS增加hover效果：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> a<span style="color: #6666ff;">.hover</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #808080; font-style: italic;">/* 你的hover效果 */</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>这样设计一个链接，感觉可以更像按钮。并且，这个模拟可以用在任何元素上。</p>
<p><strong>iphone fixed positioning</strong></p>
<p>关于漂浮定位，测试后发现 <b>{</b> position: fixed; <b>}</b> 不能为其用，<br />
可以改为 <b>{</b> position:absolute; <b>}</b> 来实现，可以使用iphone看下<a href="http://uecss.com/demo/jeff/iphone-fixed-positioning/">DEMO：iphone-fixed-positioning</a></p>
<p>参考资料：</p>
<p><a rel="nofollow" href="http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/">iPhone CSS—tips for building iPhone websites</a></p>
<p><a rel="nofollow" href="http://davidwalsh.name/detect-iphone">iPhone &#038; iPod Detection Using Javascript</a></p>
<p><a rel="nofollow" href="http://articles.sitepoint.com/article/iphone-development-12-tips/">iPhone Development: 12 Tips To Get You Started</a></p>
<p><a href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/">Tutorial: Building a website for the iPhone</a></p>
<p><a rel="nofollow" href="http://www.evotech.net/blog/2008/12/hover-pseudoclass-for-the-iphone/">hover pseudoclass for the iPhone</a></p>
<p><a rel="nofollow" href="http://doctyper.com/archives/200808/fixed-positioning-on-mobile-safari/">fixed-positioning-on-mobile-safari</a></p>
<p><a rel="nofollow" href="http://developer.apple.com/safari/library/technotes/tn2010/tn2262/index.html">Preparing Your Web Content for iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uecss.com/iphone-ipad-web-development-skills.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPtouch iPhone Theme</title>
		<link>http://uecss.com/wptouch-iphone-theme.html</link>
		<comments>http://uecss.com/wptouch-iphone-theme.html#comments</comments>
		<pubDate>Sun, 31 Jan 2010 12:23:03 +0000</pubDate>
		<dc:creator>猪的明天</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wap]]></category>

		<guid isPermaLink="false">http://uecss.com/?p=149</guid>
		<description><![CDATA[WPtouch iPhone Theme这款wp插件是专门为iPhone或iPod Touch用户而开发的，新的界面主题，兼容性良好，用你的iphone iPod Touch 这些玩意儿访问本站 （手机浏览器输入UECSS.COM）即可，下图是俺的水货iphone截屏快照（home+锁屏键）： 附上官方下载地址：点击这里进入下载页面]]></description>
			<content:encoded><![CDATA[<p><strong>WPtouch iPhone Theme</strong>这款wp插件是专门为iPhone或iPod Touch用户而开发的，新的界面主题，兼容性良好，用你的iphone iPod Touch 这些玩意儿访问本站 （手机浏览器输入<a href="http://uecss.com/">UECSS.COM</a>）即可，下图是俺的水货iphone截屏快照（home+锁屏键）：<span id="more-149"></span><br />
<img class="alignnone size-full wp-image-150" src="http://uecss.com/wp-content/uploads/2010/01/照片.jpg" alt="" width="320" height="480" /></p>
<p>附上官方下载地址：<a href="http://wordpress.org/extend/plugins/wptouch/">点击这里进入下载页面</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uecss.com/wptouch-iphone-theme.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

