<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/feedsky2.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/PlayGoogleKarry" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/PlayGoogleKarry" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 01 Dec 2010 15:13:40 GMT</lastBuildDate><title>Play Google玩转谷歌</title><description>学习笔记，成长历程</description><link>http://playgoogle.com</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Wed, 12 Jan 2011 14:06:14 GMT</pubDate><item><title>CSS3中Media Queries</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440061/5589304/1/item.html</link><content:encoded>&lt;p&gt;在做一个移动版WEB时，遇到一个问题。 由于手机屏幕宽度限制，我希望给图片设置一个max-width,如：&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;.content img  { max-width:320px;&lt;br /&gt;
}&lt;/div&gt;
&lt;p&gt;但我又希望在ipad一类大屏幕移动设备上让图片尽可能的大，常规思路是使用javascript判断当前设备的分辨率，然后分别做处理。&lt;br /&gt;
一番查询之后发现，CSS3 的Media Queries 能轻易解决这个问题。 在 CSS2 中，我们常看到这样的代码：&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;type=&amp;#8221;text/css&amp;#8221; href=&amp;#8221;core.css&amp;#8221; media=&amp;#8221;screen&amp;#8221; /&amp;gt;  media=&amp;#8221;print&amp;#8221; /&amp;gt;&lt;/div&gt;
&lt;p&gt;很清楚的是&lt;br /&gt;
core.css将针对屏幕时使用，而print.css针对打印时使用。 在 CSS3 中，提供了更多丰富的媒体查询方式。 如：&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;type=&amp;#8221;text/css&amp;#8221; media=&amp;#8221;screen and (max-device-width: 480px)&amp;#8221;&lt;br /&gt;
href=&amp;#8221;shetland.css&amp;#8221; /&amp;gt;&lt;/div&gt;
&lt;p&gt;它包含两层意思，首先，是在屏幕上使用，并且（and），该设备的分辨率宽度不超过480px。 你也可以在css中针对某一部分样式使用：&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;/*为宽度大于760像素的设备使用：*/ @media screen and&lt;br /&gt;
(min-device-width: 760px){ .content img { max-width:760px; }&lt;br /&gt;
}&lt;/div&gt;
&lt;p&gt;更多Media Queries 相关内容，到W3C上去看： href=&amp;#8221;http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/#media0&amp;#8243;&amp;gt;http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/#media0&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440061/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440061/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440061/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440061/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=422</wfw:commentRss><slash:comments>2</slash:comments><description>在做一个移动版WEB时，遇到一个问题。 由于手机屏幕宽度限制，我希望给图片设置一个max-width,如：
.content img  { max-width:320px;
}
但我又希望在ipad一类大屏幕移动设备上让图片尽可能的大，常规思路是使用javascript判断当前设备的分辨率，然后分别做处理。
一番查询之后发现，CSS3 的Media Queries 能轻易解决这个问题。 在 CSS2 中，我们常看到这样的代码：
type=&amp;#8221;text/css&amp;#8221; href=&amp;#8221;core.css&amp;#8221; media=&amp;#8221;screen&amp;#8221; /&amp;#62;  media=&amp;#8221;print&amp;#8221; /&amp;#62;
很清楚的是
core.css将针对屏幕时使用，而print.css针对打印时使用。 在 CSS3 中，提供了更多丰富的媒体查询方式。 如：
type=&amp;#8221;text/css&amp;#8221; media=&amp;#8221;screen and (max-device-width: 480px)&amp;#8221;
href=&amp;#8221;shetland.css&amp;#8221; /&amp;#62;
它包含两层意思，首先，是在屏幕上使用，并且（and），该设备的分辨率宽度不超过480px。 你也可以在css中针对某一部分样式使用：
/*为宽度大于760像素的设备使用：*/ @media screen and
(min-device-width: 760px){ .content img { max-width:760px; }
}
更多Media Queries 相关内容，到W3C上去看： href=&amp;#8221;http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/#media0&amp;#8243;&amp;#62;http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/#media0&lt;img src=&quot;http://www1.feedsky.com/t1/463440061/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440061/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440061/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440061/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>XHTML+CSS</category><category>media queries</category><category>未分类</category><category>css3</category><pubDate>Wed, 01 Dec 2010 23:13:40 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=422#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=422</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=422</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440061/5589304</fs:itemid></item><item><title>整理：在 IE6 和IE7 中a标签中的内联元素触发IE 的 haslayout属性后，链接无效的BUG</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440062/5589304/1/item.html</link><content:encoded>&lt;p&gt;昨天在工作中遇到一个诡异的现象，老版本IE( IE6 和IE7) 导航栏a标签无法正常使用，但onclick事件能正常执行。&lt;/p&gt;
&lt;p&gt;经反复测试发现：&lt;/p&gt;
&lt;p&gt;a标签内嵌套一层或多层内联元素（如span label em 等）, 最终的内联元素包含一个img元素, 这时, 如果触发了a元素和img元素之间的任何一个元素的hasLayout, 那么超链接将失效.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&amp;lt;a href=&amp;#8221;http://playgoogle.com&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;span&amp;gt;&amp;lt;img src=&amp;#8221;test.jpg&amp;#8221; alt=&amp;#8221;test&amp;#8221; title=&amp;#8221;test&amp;#8221; /&amp;gt;&amp;lt;/span&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/a&amp;gt;&lt;/p&gt;
&lt;p&gt;span {&lt;/p&gt;
&lt;p&gt;&lt;em&gt;display: inline-block;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;}
&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;有三种解决办法：&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;不要在a标签内嵌套任何内联元素，使用其他方式实现。&lt;/li&gt;
&lt;li&gt;不要触发内联元素的haslayout属性。&lt;/li&gt;
&lt;li&gt;对img 设置相对定位，并把z-index设置为负值。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;注：内联元素触发haslayout 的条件：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.moonless.net/demo/9/&quot; target=&quot;_blank&quot;&gt;http://www.moonless.net/demo/9/&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440062/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440062/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440062/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440062/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=404</wfw:commentRss><slash:comments>0</slash:comments><description>昨天在工作中遇到一个诡异的现象，老版本IE( IE6 和IE7) 导航栏a标签无法正常使用，但onclick事件能正常执行。
经反复测试发现：
a标签内嵌套一层或多层内联元素（如span label em 等）, 最终的内联元素包含一个img元素, 这时, 如果触发了a元素和img元素之间的任何一个元素的hasLayout, 那么超链接将失效.

&amp;#60;a href=&amp;#8221;http://playgoogle.com&amp;#8221;&amp;#62;
&amp;#60;span&amp;#62;&amp;#60;img src=&amp;#8221;test.jpg&amp;#8221; alt=&amp;#8221;test&amp;#8221; title=&amp;#8221;test&amp;#8221; /&amp;#62;&amp;#60;/span&amp;#62;
&amp;#60;/a&amp;#62;
span {
display: inline-block;
}

有三种解决办法：

不要在a标签内嵌套任何内联元素，使用其他方式实现。
不要触发内联元素的haslayout属性。
对img 设置相对定位，并把z-index设置为负值。

注：内联元素触发haslayout 的条件：
http://www.moonless.net/demo/9/&lt;img src=&quot;http://www1.feedsky.com/t1/463440062/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440062/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440062/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440062/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>ie bug</category><category>XHTML+CSS</category><pubDate>Fri, 26 Nov 2010 10:14:22 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=404#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=404</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=404</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440062/5589304</fs:itemid></item><item><title>2010年11月 – Web标准化交流会</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440063/5589304/1/item.html</link><content:encoded>&lt;p&gt;&lt;img class=&quot;size-full wp-image-394 alignnone&quot; title=&quot;WEB 标准化交流会&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/11/h1.jpg&quot; alt=&quot;&quot; width=&quot;493&quot; height=&quot;78&quot; /&gt;&lt;/p&gt;
&lt;p&gt;我们公司为本月的Web 标准化交流会上海站提供场地支持，欢迎大家的到来。&lt;br /&gt;
WEB标准化交流会官网：&lt;a href=&quot;http://www.w3ctech.com/&quot;&gt;http://www.w3ctech.com/&lt;/a&gt;&lt;br /&gt;
报名地址：&lt;a href=&quot;http://www.w3ctech.com/joinus/&quot;&gt;http://www.w3ctech.com/joinus/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;地址：上海市杨浦区淞沪路290号创智天地广场十号楼6楼&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;size-full wp-image-395 alignnone&quot; title=&quot;1&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/11/1.png&quot; alt=&quot;&quot; width=&quot;580&quot; height=&quot;469&quot; /&gt;&lt;/p&gt;
&lt;p&gt;可以乘坐地铁&lt;strong&gt;10号线&lt;/strong&gt; &lt;strong&gt;江湾体育馆站&lt;/strong&gt; 下车后，沿淞沪路往政立路方向步行5分钟即到。10号楼为挂着 “&lt;strong&gt;ORACLE（甲骨文）”&lt;/strong&gt; LOGO 的那栋。&lt;br /&gt;
====================================================================&lt;br /&gt;
&lt;a href=&quot;http://playgoogle.com/wp-content/uploads/2010/11/p730555941.jpg&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-411&quot; title=&quot;p730555941&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/11/p730555941.jpg&quot; alt=&quot;&quot; width=&quot;600&quot; height=&quot;398&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;这次交流会举办的比我预期的要好。在欲波一段轻松的行业动态和八卦之后，进入了正题。&lt;/p&gt;
&lt;p&gt;主要由winter为大家讲解浏览器解析一个网页的流程，从浏览器工程师的角度给前端工程师们深入剖析了从用户输入URL到页面呈现浏览器所做的所有事情。信息密集，条理清楚，特别是对DOM树渲染方面令我印象深刻。以前一直认为浏览器会先构建dom树，然后再根据css逐个查找匹配的DOM渲染样式，而事实恰好相反，浏览器先对CSS样式进行索引，渲染DOM树时根据索引过的CSS来渲染DOM。这也是为什么性能优化上建议把 CSS前置的一个原因。希望以后有更多这样深入的交流。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440063/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440063/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440063/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440063/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=393</wfw:commentRss><slash:comments>2</slash:comments><description>我们公司为本月的Web 标准化交流会上海站提供场地支持，欢迎大家的到来。
WEB标准化交流会官网：http://www.w3ctech.com/
报名地址：http://www.w3ctech.com/joinus/
地址：上海市杨浦区淞沪路290号创智天地广场十号楼6楼

可以乘坐地铁10号线 江湾体育馆站 下车后，沿淞沪路往政立路方向步行5分钟即到。10号楼为挂着 “ORACLE（甲骨文）” LOGO 的那栋。
====================================================================

这次交流会举办的比我预期的要好。在欲波一段轻松的行业动态和八卦之后，进入了正题。
主要由winter为大家讲解浏览器解析一个网页的流程，从浏览器工程师的角度给前端工程师们深入剖析了从用户输入URL到页面呈现浏览器所做的所有事情。信息密集，条理清楚，特别是对DOM树渲染方面令我印象深刻。以前一直认为浏览器会先构建dom树，然后再根据css逐个查找匹配的DOM渲染样式，而事实恰好相反，浏览器先对CSS样式进行索引，渲染DOM树时根据索引过的CSS来渲染DOM。这也是为什么性能优化上建议把 CSS前置的一个原因。希望以后有更多这样深入的交流。&lt;img src=&quot;http://www1.feedsky.com/t1/463440063/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440063/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440063/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440063/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>乱七八糟</category><pubDate>Sun, 21 Nov 2010 21:05:31 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=393#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=393</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=393</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440063/5589304</fs:itemid></item><item><title>javascript拖拽功能–基于jQuery</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440064/5589304/1/item.html</link><content:encoded>&lt;p&gt;最近一直在忙iphone的项目，好久没有写js了。周末练练手。&lt;/p&gt;
&lt;pre&gt;if(typeof Fminutes ===&quot;undefined&quot;){
Fminutes = {};
}

    /*
    * 拖拽实现
    * */
    var dragOption = {
        $element:null, //可触发拖拽的区域，jQuery对象
        $target:null,//被拖动的控件，jQuery对象
        move:$.noop, //移动过程中的回调
        up:$.noop//拖拽结束之后的回调
    };
    Fminutes.Drag = function(option){
        this.option = $.extend(true,{},dragOption,option);
        this._status = 0;          //私有属性，当前状态，0为停止状态，1为鼠标按下状态，2为鼠标拖动状态
        this._mouseDownPosition = {x:0,y:0};
        this._beginDownPosition = {x:0,y:0};
        this.init();
    };
    Fminutes.Drag.prototype = {
        init:function(){
            this.bindEvents();
        },
        bindEvents:function(){
            var that = this;
            $(that.option.$element).bind(&quot;mousedown&quot;,function(e){
                that._beginDownPosition = that._getMousePosition(e);
                that._mouseDownPosition = that._beginDownPosition;
                $(document).bind(&quot;mousemove&quot;,_move);
                $(document).bind(&quot;mouseup&quot;,_up);
                that._status = 1;

            });
            //移动事件绑定
            function _move(e) {
                    if (that._status == 0) {
                        return;
                    }
                    that._status = 2;
                    var mousePosition = that._getMousePosition(e);
                    var target = that.option.$target;
                    var position = {};
                    position.left = target.offset().left + (mousePosition.x - that._mouseDownPosition.x);
                    position.top = target.offset().top + (mousePosition.y - that._mouseDownPosition.y);
                    that._mouseDownPosition = mousePosition;
                    target.css({&quot;left&quot;:position.left + &quot;px&quot;,&quot;top&quot;:position.top + &quot;px&quot;});
                    //回调
                    that.option.move.call(that,e,position);
                }
            //鼠标放开事件绑定
            function _up()
            {
                if (that._status != 2) {
                    that._status = 0;
                    return
                }
                $(document).unbind(&quot;mousemove&quot;, _move);
                $(document).unbind(&quot;mouseup&quot;,_up);
                that._status = 0;
                //回调
                that.option.up.call(that);
            }
        },
        //计算鼠标当前所在位置
        _getMousePosition:function(e) {
            if (e.pageX || e.pageY) {
                return{x:e.pageX , y:e.pageY };
            }
            return {
                x:e.clientX + document.body.scrollLeft - document.body.clientLeft,
                y:e.clientY + document.body.scrollTop - document.body.clientTop
            };
        }
    };&lt;/pre&gt;
&lt;p&gt;使用方式：&lt;/p&gt;
&lt;pre&gt;         new Fminutes.Drag({
               $element:that.$title,
               $target:that.$dialog
        });&lt;/pre&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440064/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440064/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440064/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440064/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=385</wfw:commentRss><slash:comments>0</slash:comments><description>最近一直在忙iphone的项目，好久没有写js了。周末练练手。
if(typeof Fminutes ===&quot;undefined&quot;){
Fminutes = {};
}

    /*
    * 拖拽实现
    * */
    var dragOption = {
        $element:null, //可触发拖拽的区域，jQuery对象
        $target:null,//被拖动的控件，jQuery对象
        move:$.noop, //移动过程中的回调
        up:$.noop//拖拽结束之后的回调
    };
    Fminutes.Drag = [...]&lt;img src=&quot;http://www1.feedsky.com/t1/463440064/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440064/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440064/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440064/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>Javascript</category><pubDate>Sat, 18 Sep 2010 08:57:03 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=385#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=385</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=385</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440064/5589304</fs:itemid></item><item><title>Objective-C学习笔记</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440065/5589304/1/item.html</link><content:encoded>&lt;p&gt;objective-c 是C语言的超集，本质和C语言一样，但语法风格迥异。这篇文章主要是介绍objctive-c的语法规则。&lt;br /&gt;
&lt;strong&gt;定义一个方法：&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;头文件中：&lt;br /&gt;
-(&lt;span style=&quot;color: #ff0000;&quot;&gt;void&lt;/span&gt;)	&lt;strong&gt;test&lt;/strong&gt;: (&lt;span style=&quot;color: #0000ff;&quot;&gt;NSString&lt;/span&gt; *) &lt;span style=&quot;color: #999999;&quot;&gt;firstName&lt;/span&gt; : (&lt;span style=&quot;color: #0000ff;&quot;&gt;NSString&lt;/span&gt; *) &lt;span style=&quot;color: #999999;&quot;&gt;lastName&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;其中 test 是方法名，firstName和lastName是两个参数，NSString声明参数的类型为字符串类型。最前面的“－”说明该方法为普通方法（即需要实例化这个类之后才可调用）。若为“＋”则声明为静态方法，即为用类名直接可调用。&lt;/p&gt;
&lt;p&gt;方法的实现：&lt;/p&gt;
&lt;p&gt;- (&lt;span style=&quot;color: #ff0000;&quot;&gt;void&lt;/span&gt;)test : (&lt;span style=&quot;color: #0000ff;&quot;&gt;NSString&lt;/span&gt; *) &lt;span style=&quot;color: #999999;&quot;&gt;firstName &lt;/span&gt;:  (&lt;span style=&quot;color: #0000ff;&quot;&gt;NSString&lt;/span&gt; *) &lt;span style=&quot;color: #999999;&quot;&gt;lastName&lt;/span&gt; {&lt;/p&gt;
&lt;p&gt;NSLog(@&amp;#8221;your first Name is:%@,your last Name is %@&amp;#8221;,firstName,lastName);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;方法的调用：&lt;/p&gt;
&lt;p&gt;[&lt;span style=&quot;color: #ff0000;&quot;&gt;self&lt;/span&gt; test:(NSString *) @&quot;karry&quot; :  (NSString *) @&quot;zhang&quot;];&lt;/p&gt;
&lt;p&gt;调用方法用［］，在objective-c里面意为发送一个消息（message）.传入参数时需要写清楚参数的类型。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;定义一个类Rectangle&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;头文件：Rectangle.h&lt;br /&gt;
&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;pre&gt;#import &amp;lt;Foundation/Foundation.h&amp;gt;
@interface Rectangle : NSObject {
NSString *name;
NSString *color;
int size;
}
//构造函数，返回值是id类型，名称可自定义
-(id) init : (NSString	*) names : (NSString *) colors: (int) sizes;
-(void) setName:(NSString *) names;
-(void) setColor:(NSString *) colors;
-(void) setSize:(int) sizes;
-(void) getArea;
@end&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;br /&gt;
第一句“@interface Rectangle : NSObject ”声明Rectangle 类继承自NSObject类。在Objective-C中，继承用“:”，并且&lt;strong&gt;不能多继承&lt;/strong&gt;。&lt;br /&gt;
用init 方法作为构造函数应该是约定俗成的习惯。理论上可以是任意名称。&lt;/p&gt;
&lt;p&gt;实现 Rectangle.m&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;pre&gt;#import &quot;Rectangle.h&quot;
@implementation Rectangle
//构造函数的实现
- (id)init:(NSString *)names : (NSString *)colors : (int)sizes {
	if(self = [super init]){
		name = names;
		color = colors;
		size = sizes;
	}
	return self;
}
-(void) setName:(NSString *) names {
name = names;
}
-(void) setColor:(NSString *) colors{
color = colors;
}
-(void) setSize:(int) sizes{
size= sizes;
}
-(void) getArea{
NSLog(@&quot;%@的颜色是%@,面积是%d&quot;,name,color,size);
}
@end&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;br /&gt;
注意init方法中的这一句：if(self = [super init]){，我并没有少写一个等号，这里就是把super 的init返回结果赋值给self.这样做是为了防止超类在初始化的过程中返回的对象不同于原先创建的对象。&lt;/p&gt;
&lt;p&gt;使用这个类：&lt;br /&gt;
首先要引入头文件：&lt;br /&gt;
&lt;code&gt;&lt;/p&gt;
&lt;pre&gt;#import &quot;Rectangle.h&quot;
//实例化一个类，直接调init函数
Rectangle *rect =
[[Rectangle alloc] init : (NSString *) @&quot;正方形&quot; : (NSString *) @&quot;红色&quot; : (int) 50];
[rect getArea];//调用方法&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440065/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440065/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440065/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440065/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=364</wfw:commentRss><slash:comments>0</slash:comments><description>objective-c 是C语言的超集，本质和C语言一样，但语法风格迥异。这篇文章主要是介绍objctive-c的语法规则。
定义一个方法：
头文件中：
-(void)	test: (NSString *) firstName : (NSString *) lastName;
其中 test 是方法名，firstName和lastName是两个参数，NSString声明参数的类型为字符串类型。最前面的“－”说明该方法为普通方法（即需要实例化这个类之后才可调用）。若为“＋”则声明为静态方法，即为用类名直接可调用。
方法的实现：
- (void)test : (NSString *) firstName :  (NSString *) lastName {
NSLog(@&amp;#8221;your first Name is:%@,your last Name is %@&amp;#8221;,firstName,lastName);
}
方法的调用：
[self test:(NSString *) @&quot;karry&quot; :  (NSString *) @&quot;zhang&quot;];
调用方法用［］，在objective-c里面意为发送一个消息（message）.传入参数时需要写清楚参数的类型。
定义一个类Rectangle
头文件：Rectangle.h
 
 

#import &amp;#60;Foundation/Foundation.h&amp;#62;
@interface Rectangle : NSObject {
NSString *name;
NSString *color;
int size;
}
//构造函数，返回值是id类型，名称可自定义
-(id) init : (NSString	*) names : (NSString *) colors: (int) sizes;
-(void) [...]&lt;img src=&quot;http://www1.feedsky.com/t1/463440065/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440065/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440065/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440065/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>objective-c</category><category>移动平台</category><category>iphone</category><pubDate>Wed, 21 Jul 2010 13:37:48 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=364#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=364</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=364</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440065/5589304</fs:itemid></item><item><title>javascript设定文本框中的指定文字为选中状态</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440066/5589304/1/item.html</link><content:encoded>&lt;p&gt;前段时间写了一个&lt;strong&gt;&lt;a href=&quot; http://playgoogle.com/?p=316&quot;&gt;获取网页中鼠标选中的文字&lt;/a&gt;&lt;/strong&gt;，这个是逆向操作，通过javascript设置文本框中的指定文字为选定状态。&lt;/p&gt;
&lt;pre&gt;
var PG={
    isIE:!-[1,],  //判断浏览器是否为IE，为IE时返回true
    /*
    * 设置文本框中的文字为选中状态，包括开始索引，不包括结束索引
    * param domObj 文本框的dom对象，start为开始索引,不填则从0开始， end为结束索引，不填则选中到文本结束
    * 若domObj参数不填，则直接返回为false.
    */
    setSelectText:function(domObj,start,end){
        if(typeof domObj !==&quot;object&quot;){
            return false;
        }
        start = start ||0;
        end = end || domObj.value.length
        domObj.focus();
        if(this.isIE){
            var range = domObj.createTextRange();
            range.move(&quot;character&quot;,start);
            range.moveEnd(&quot;character&quot;,end-start);
            range.select();
        }else{
            domObj.setSelectionRange(start,end)
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://playgoogle.com/demo/setSelectText.html&quot; target=&quot;_blank&quot;&gt;【测试页面】&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440066/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440066/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440066/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440066/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=351</wfw:commentRss><slash:comments>1</slash:comments><description>前段时间写了一个获取网页中鼠标选中的文字，这个是逆向操作，通过javascript设置文本框中的指定文字为选定状态。

var PG={
    isIE:!-[1,],  //判断浏览器是否为IE，为IE时返回true
    /*
    * 设置文本框中的文字为选中状态，包括开始索引，不包括结束索引
    * param domObj 文本框的dom对象，start为开始索引,不填则从0开始， end为结束索引，不填则选中到文本结束
    * 若domObj参数不填，则直接返回为false.
    */
    setSelectText:function(domObj,start,end){
        if(typeof domObj !==&quot;object&quot;){
        [...]&lt;img src=&quot;http://www1.feedsky.com/t1/463440066/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440066/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440066/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440066/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>Javascript</category><category>选中文字</category><pubDate>Sat, 05 Jun 2010 12:12:50 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=351#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=351</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=351</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440066/5589304</fs:itemid></item><item><title>Dict–我的chrome词典插件</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440067/5589304/1/item.html</link><content:encoded>&lt;p&gt;&lt;a href=&quot;http://playgoogle.com/wp-content/uploads/2010/05/icon.png&quot;&gt;&lt;img class=&quot;alignleft size-full wp-image-326&quot; title=&quot;DICT&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/05/icon.png&quot; alt=&quot;DICT&quot; width=&quot;113&quot; height=&quot;113&quot; /&gt;&lt;/a&gt;前段时间Kevin做了一个很不错的翻译工具&amp;#8211;&lt;a href=&quot;http://www.comsome.com/someyi/&quot; target=&quot;_blank&quot;&gt;尚译&lt;/a&gt;，使用的是google language api，用起来感觉很方便。由于是油猴脚本（Grease Monkey），每次使用都要在导航栏点击一次。 另外，这个脚本主要侧重于翻译，对于我自己并不是很适用，决定做一个适合自己使用的chrome词典小插件，关注单词的发音和用法，顺便也学习一下&lt;a href=&quot;http://code.google.com/chrome/extensions/getstarted.html&quot; target=&quot;_blank&quot;&gt;Google Chrome Extensions&lt;/a&gt; 的开发。&lt;/p&gt;
&lt;p&gt;我将这个插件命名为&amp;#8221;Dict&amp;#8221;，基于&lt;a href=&quot;http://code.google.com/intl/zh-CN/apis/ajaxlanguage/documentation/&quot; target=&quot;_blank&quot;&gt;google language api&lt;/a&gt; 、 dict.cn和有道词典，中文翻译为英文，单词和词组有音标和例句和发音，其他语言翻译成中文。现在工作中偶尔也要用到日文，所以也附带做了简单的日文翻译功能。&lt;/p&gt;
&lt;p&gt;一开始就为了满足自己的需求而开发，所以这个插件不一定适合你，如果你恰好和我有相似的需求，也欢迎你使用。&lt;/p&gt;
&lt;p&gt;用google chrome 浏览器打开： &lt;a href=&quot;https://chrome.google.com/extensions/detail/ifakalflbmnnimcaihdhhfodpceiniio&quot; target=&quot;_blank&quot;&gt;chrome词典小插件&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;点击安装之后你会在浏览器右上角看到一个红色的小图标。点击红色小图标：&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-328&quot; title=&quot;dict2&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/05/dict2.png&quot; alt=&quot;&quot; width=&quot;344&quot; height=&quot;146&quot; /&gt;&lt;/p&gt;
&lt;p&gt;输入你要查询的单词，回车：&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;aligncenter size-full wp-image-327&quot; title=&quot;dict1&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/05/dict1.png&quot; alt=&quot;&quot; width=&quot;367&quot; height=&quot;266&quot; /&gt;&lt;/p&gt;
&lt;p&gt;鼠标放在黄色的喇叭按钮上，会有单词的读音。你也可以输入中文：&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;aligncenter size-full wp-image-329&quot; title=&quot;dict3&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/05/dict3.png&quot; alt=&quot;Dictionary-chrome 小插件&quot; width=&quot;354&quot; height=&quot;274&quot; /&gt;&lt;/p&gt;
&lt;p&gt;如果你觉得单词的解释和例句不够完整，可以点击右下角的&amp;#8221;google dictionary&amp;#8221; 在google提供的词典中查看更加完整的信息。&lt;/p&gt;
&lt;p&gt;你也可以输入整句获得翻译，当然，句子是没有发音和音标的：&lt;img class=&quot;aligncenter size-full wp-image-336&quot; title=&quot;dict4&quot; src=&quot;http://playgoogle.com/wp-content/uploads/2010/05/dict4.png&quot; alt=&quot;&quot; width=&quot;339&quot; height=&quot;232&quot; /&gt;&lt;/p&gt;
&lt;p&gt;正在考虑是否加上屏幕取词的功能，可能下一个版本加上该功能，对这个插件有任何建议也欢迎和我交流。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440067/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440067/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440067/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440067/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=325</wfw:commentRss><slash:comments>3</slash:comments><description>前段时间Kevin做了一个很不错的翻译工具&amp;#8211;尚译，使用的是google language api，用起来感觉很方便。由于是油猴脚本（Grease Monkey），每次使用都要在导航栏点击一次。 另外，这个脚本主要侧重于翻译，对于我自己并不是很适用，决定做一个适合自己使用的chrome词典小插件，关注单词的发音和用法，顺便也学习一下Google Chrome Extensions 的开发。
我将这个插件命名为&amp;#8221;Dict&amp;#8221;，基于google language api 、 dict.cn和有道词典，中文翻译为英文，单词和词组有音标和例句和发音，其他语言翻译成中文。现在工作中偶尔也要用到日文，所以也附带做了简单的日文翻译功能。
一开始就为了满足自己的需求而开发，所以这个插件不一定适合你，如果你恰好和我有相似的需求，也欢迎你使用。
用google chrome 浏览器打开： chrome词典小插件
点击安装之后你会在浏览器右上角看到一个红色的小图标。点击红色小图标：

输入你要查询的单词，回车：

鼠标放在黄色的喇叭按钮上，会有单词的读音。你也可以输入中文：

如果你觉得单词的解释和例句不够完整，可以点击右下角的&amp;#8221;google dictionary&amp;#8221; 在google提供的词典中查看更加完整的信息。
你也可以输入整句获得翻译，当然，句子是没有发音和音标的：
正在考虑是否加上屏幕取词的功能，可能下一个版本加上该功能，对这个插件有任何建议也欢迎和我交流。&lt;img src=&quot;http://www1.feedsky.com/t1/463440067/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440067/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440067/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440067/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>chrome 插件</category><category>Google Map API</category><category>英汉词典</category><category>google language api</category><category>汉英词典</category><pubDate>Sat, 22 May 2010 21:41:39 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=325#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=325</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=325</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440067/5589304</fs:itemid></item><item><title>获取网页中鼠标选中的文字</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440068/5589304/1/item.html</link><content:encoded>&lt;p&gt;最近在做一个chrome插件，需要用到捕获鼠标选中的文字，发现各浏览器兼容性解决起来挺麻烦，总结了一下，方便以后使用。&lt;/p&gt;
&lt;p&gt;直接看代码：&lt;/p&gt;
&lt;pre&gt;
 var PG={
            isIE:!-[1,],  //判断浏览器是否为IE，为IE时返回true
            getText:function(){
                 if(this.isIE){
                     return this._getText();
                }else{
                    var element = document.activeElement;
                    if (element &amp;#038;&amp;#038; (element.tagName.toLowerCase() == 'input' || element.tagName.toLowerCase() == 'textarea')) {
                        return this._getTextInput()
                    } else {
                        return this._getText()
                    }
                }
            },
            _getText:function(){
                if (window.getSelection) {
                    return window.getSelection().toString();
                } else if (document.selection &amp;#038;&amp;#038; document.selection.createRange) {
                    return document.selection.createRange().text;
                }
                return &quot;&quot;;
            },
            //获取非IE浏览器中input框和textarea框中的文字
            _getTextInput:function(){
                var element = document.activeElement;
                if (element.selectionStart != undefined &amp;#038;&amp;#038; element.selectionEnd != undefined) {
                    return element.value.substring(element.selectionStart, element.selectionEnd);
                }
                return &quot;&quot;;
            }
        }
&lt;/pre&gt;
&lt;p&gt;使用方法：&lt;/p&gt;
&lt;pre&gt;
 document.onmouseup = function(){
            alert(&quot;您选中的文字是：&quot;+PG.getText());
        }
&lt;/pre&gt;
&lt;p&gt;点击查看：&lt;a href=&quot;http://playgoogle.com/demo/get-selection.html&quot;&gt;[测试示例]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;参考：&lt;br /&gt;
&lt;a href=&quot;http://www.quirksmode.org/dom/range_intro.html&quot;&gt;PPK ：Introduction to Range&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://help.dottoro.com/ljcvonpc.php&quot;&gt;getSelection method (window)&lt;/a&gt;&lt;br /&gt;
 &lt;a href=&quot;http://blog.csdn.net/rfb0204421/archive/2009/04/01/4040488.aspx&quot;&gt;document.selection.createRange方法&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440068/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440068/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440068/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440068/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=316</wfw:commentRss><slash:comments>2</slash:comments><description>最近在做一个chrome插件，需要用到捕获鼠标选中的文字，发现各浏览器兼容性解决起来挺麻烦，总结了一下，方便以后使用。
直接看代码：

 var PG={
            isIE:!-[1,],  //判断浏览器是否为IE，为IE时返回true
            getText:function(){
                 if(this.isIE){
          [...]&lt;img src=&quot;http://www1.feedsky.com/t1/463440068/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440068/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440068/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440068/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>鼠标选中文字</category><category>mouseup</category><category>window.getSelection()</category><category>Javascript</category><pubDate>Sun, 16 May 2010 21:24:20 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=316#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=316</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=316</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440068/5589304</fs:itemid></item><item><title>WAP开发相关资源收集</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440069/5589304/1/item.html</link><content:encoded>&lt;h2&gt;交互原则&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Strive for consistency&lt;/strong&gt;&lt;strong&gt;.&lt;/strong&gt;力求一致&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enable frequent users to use shortcuts.&lt;/strong&gt;允许频繁的使用快捷键&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Offer informative feedback.&lt;/strong&gt;提供明确的反馈&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design dialog to yield closure.&lt;/strong&gt;设计对话，告诉用户任务已完成&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Offer simple error handling.&lt;/strong&gt;提供错误预防和简单的纠错能力&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Permit easy reversal of actions.&lt;/strong&gt;应该方便用户取消某个操作&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Support internal locus of control.&lt;/strong&gt;用户应掌握控制权&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduce short-term memory load.&lt;/strong&gt;减轻用户的记忆负担&lt;/li&gt;
&lt;/ol&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;尽量减少操作的步骤&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;尽量利用点击来代替输入&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;时刻让用户知道自己所处的位置&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;与web保持一致且数据同步&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;为输入法让出空间&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;摘要形式展现信息&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;导航和提示处于明显的位置&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;减少滚动&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;界面简洁的途径：&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;减少控件的数目，使程序的主功能显然易见，引导用户操作。&lt;/li&gt;
&lt;li&gt;当内容过多时，要突出重要信息，便于用户快速浏览。&lt;/li&gt;
&lt;li&gt;显示出错信息时，不要只告知用户程序出现错误，要提供有用的信息引导用户完成操作。&lt;/li&gt;
&lt;li&gt;手机上网的速度慢，一般在&lt;a href=&quot;http://ucdchina.com/snap/5466&quot; target=&quot;_blank&quot;&gt;6k/s&lt;/a&gt;，这就要求页面的内容尽量精简，避免过多的图片。&lt;/li&gt;
&lt;li&gt;页面的内容控制在两屏以内，也不能空白。比如当用户支付电影票之后，不能只显示“支付成功”，可以引导用户使用其他功能。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;操作方式&lt;/h2&gt;
&lt;p&gt;手机操作有物理按键和触摸等多种操作方式，当同样的程序要在多种操作方式下使用，需顾及手指点击时可点区域的大小。使用物理按键时，按钮可以只是两个字，选中控件即可操作，而iPhone的可点击区域最好不低于44×44像素。&lt;/p&gt;
&lt;h2&gt;分辨率种类（不完全统计）：&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;128*128  128*160 130*130  176*144  176*220 208*208 208*320  240*160 240*240 240*260&lt;/li&gt;
&lt;li&gt;240*320 240*400 240*432 240*480 320*240 320*320 320*400 320*480 345*800 352*416&lt;/li&gt;
&lt;li&gt;360*480 360*640 400*800 480*320 480*360&lt;/li&gt;
&lt;li&gt;480*640 480*800 480*854 480*864 640*480  800*480&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;手机浏览器兼容性测试结果概要&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;注意：&lt;/strong&gt;以下所说的“大多数”是指在我们测试过的机型中，发生此类状况的手机占比达50%及以上，“部分”为20%到50%；“少数”为20%及以下。而这个概率也仅仅只限于我们所测试过的机型，虽然我们采集的样本尽量覆盖各种特征的手机，但并不代表所有手机的情况。&lt;/p&gt;
&lt;h4&gt;XHTML部分&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;大多数手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;表单元素的“disable”属性&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;部分手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“button”标签&lt;/li&gt;
&lt;li&gt;“input[type=file]“标签&lt;/li&gt;
&lt;li&gt;“iframe”标签。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;虽然只有部分手机不支持这几个标签，但因为这些标签在页面中往往具有非常重要的功能，所以属于高危标签，要谨慎使用。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;少数手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“select”标签：该标签如果被赋予比较复杂的CSS属性，可能会导致显示不正常，比如”vertical-align:middle”。&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;CSS部分&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;大部分手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“font-family”属性：因为手机基本上只安装了宋体这一种中文字体；&lt;/li&gt;
&lt;li&gt;“font-family:bold;”：对中文字符无效，但一般对英文字符是有效的；&lt;/li&gt;
&lt;li&gt;“font-style: italic;”：同上；&lt;/li&gt;
&lt;li&gt;“font-size”属性：比如12px的中文和14px的中文看起来一样大，当字符大小为18px的时候你也许能看出来一些区别；&lt;/li&gt;
&lt;li&gt;“white-space/word-wrap”属性：无法设置强制换行，所以当你网页有很多中文的时候，需要特别关注不要让过多连写的英文字符撑开页面；&lt;/li&gt;
&lt;li&gt;“background-position”属性：但背景图片的其他属性设定是支持的；&lt;/li&gt;
&lt;li&gt;“position”属性；&lt;/li&gt;
&lt;li&gt;“overflow”属性；&lt;/li&gt;
&lt;li&gt;“display”属性；&lt;/li&gt;
&lt;li&gt;“min-height”和”min-weidth”属性；&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;部分手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“height”属性：对”height”的支持不太好，奇怪的是在我们的测试当中，仅仅只有很少部分手机不支持”width”属性；&lt;/li&gt;
&lt;li&gt;“pading”属性&lt;/li&gt;
&lt;li&gt;“margin”属性：更高比例的手机不支持”margin”的负值。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;少数手机不支持的：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;少数手机对CSS完全不支持；&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;JavaScript部分&lt;/h4&gt;
&lt;p&gt;这部分测试相对不那么让人抓狂，要么干脆不支持，如果支持的话，对基本的dom操作、事件等支持度都还不错。但我们没有测试过很复杂的脚本。&lt;/p&gt;
&lt;p&gt;在我们测试过的手机当中，支持（包括不完全支持）JavaScript的手机比例大约在一半左右，当然，对于我们来说，最重要的不是这个比例，而是要如何做好JavaScript的优雅降级。&lt;/p&gt;
&lt;h4&gt;其他&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;部分手机不支持png8和png24，所以尽量使用jpg和gif的图片&lt;/li&gt;
&lt;li&gt;另外对于平滑的渐变等精细的图片细节，部分手机的色彩支持度并不能达到要求，所以慎用有平滑渐变的bar设计&lt;/li&gt;
&lt;li&gt;部分手机对于超大图片，既不进行缩放，也不显示横下滚动条&lt;/li&gt;
&lt;li&gt;少数手机在打开超过20k的测试页面时，会显示内存不足&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;开发中你需要注意的问题&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;手机网页编码需要遵循什么规范？&lt;/strong&gt;&lt;br /&gt;
遵循XHTML Mobile Profile规范（&lt;a title=&quot;http://www.openmobilealliance.org/tech/affiliates/LicenseAgreement.asp?DocName=/wap/wap-277-xhtmlmp-20011029-a.pdf&quot; rel=&quot;nofollow&quot; href=&quot;http://www.openmobilealliance.org/tech/affiliates/LicenseAgreement.asp?DocName=/wap/wap-277-xhtmlmp-20011029-a.pdf&quot;&gt;WAP-277-XHTMLMP-20011029-a.pdf&lt;/a&gt;），简称为XHTML MP，也就是通常说的WAP2.0规范。 &lt;acronym title=&quot;Extensible HyperText Markup Language&quot;&gt;XHTML&lt;/acronym&gt;MP是为不支持XHTML的全部特性且资源有限的客户端所设计的。它以XHTML Basic为基础，加入了一些来自XHTML 1.0的元素和属性。这些内容包括一些其他元素和对内部样式表的支持。和XHTML Basic相同，XHTML MP是严格的XHTML 1.0子集。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;网页文档推荐使用扩展名？&lt;/strong&gt;&lt;br /&gt;
推荐命名为xhtml，按WAP2.0的规范标准写成html/htm等也是可以的。但少数手机对html支持的不好。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;为什么现今大多数的网站一行字数上限为14个中文字符？&lt;/strong&gt;&lt;br /&gt;
由于手持设备的特殊性，其页面中实际文字大小未必是我们在CSS中设定的文字大小，尤其是在第三方浏览器中。例如Nokia5310，其内置浏览器 页面内文字大小与CSS设定相符，但是第三方浏览器OperaMini与UCWEB页面内文字大小却大于CSS设定。经测试，其文本大概在16px左右。 假如屏幕分辨率宽度为240px，去除外边距，那么其一行显示14个字以内，是比较保险（避免文本换行）的做法。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;使用WCSS还是CSS？&lt;/strong&gt;&lt;br /&gt;
WCSS (WAP Cascading Style Sheet 或称 WAP CSS)是移动版本的CSS样式表。它是CSS2的一个子集，去掉了一些不适于移动互联网特性的属性，并加入一些具有WAP特性的扩展（如-wap-input-format/-wap-input-required/display:-wap-marquee等）。 需要留意的是，这些特殊的属性扩展并不是很实用，所以在实际的项目开发当中，不推荐使用WCSS特有的属性。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;避免空值属性&lt;/strong&gt;&lt;br /&gt;
如果属性值为空，在web页面中是完全没有问题的，但是在大部分手机网页上会报错。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;网页大小限制&lt;/strong&gt;&lt;br /&gt;
建议低版本页面不超过15k，高版本页面不超过60k。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;用手机模拟器和第三方手机浏览器的在线模拟器来测试页面是不是靠谱？&lt;/strong&gt;&lt;br /&gt;
有条件的话，我们当然建议在手机实体上进行测试，因为目标客户群的手机设备总是在不断变化的，这些手机模拟器通常不能完全正确的模拟页面在手机上的显示情况，比如图片色彩，页面大小限制等就很难再模拟器上测试出来。当然，一些第三方手机浏览器的在线模拟器还是可以进行测试的，第三方浏览器相对来说受手机设备的影响较小。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;参考网站&lt;/h2&gt;
&lt;h3&gt;交互&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://daichuanqing.com/index.php/archives/1042&quot;&gt;手机交互设计原则&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://daichuanqing.com/index.php/archives/1326&quot;&gt;再议手机交互设计原则&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://1yen.cn/?p=181&quot;&gt;Android菜单设计指南&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://elyaaa.com/product/536.html&quot;&gt;从大屏幕到小屏幕迁移的三种设计方案&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://elyaaa.com/userexp/510.html&quot;&gt;手机客户端交互设计原则及信息展现方式&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://daichuanqing.com/index.php/archives/1326&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://elyaaa.com/userexp/510.html&quot;&gt;&lt;/a&gt;开发&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://phparch.cn/index.php/web/66-mobile/188&quot;&gt;XHTML 移动概要 (XHTML MP) / WAP 2.0 教程&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.w3.org/TR/xhtml-basic/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.w3.org/TR/xhtml-basic/&quot;&gt;W3C：XHTML Basic 1.1规范.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.w3.org/2005/MWI/Tests/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.w3.org/2005/MWI/Tests/&quot;&gt;W3C：Mobile Web Test Suites Working Group.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.quirksmode.org/m/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.quirksmode.org/m/&quot;&gt;PPK：关于手机浏览器兼容性的测试和研究.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.w3.org/TR/xhtml-basic/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.w3.org/TR/xhtml-basic/&quot;&gt;W3C：XHTML Basic 1.1规范.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.w3.org/2005/MWI/Tests/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.w3.org/2005/MWI/Tests/&quot;&gt;W3C：Mobile Web Test Suites Working Group.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;http://www.quirksmode.org/m/&quot; rel=&quot;nofollow&quot; href=&quot;http://www.quirksmode.org/m/&quot;&gt;PPK：关于手机浏览器兼容性的测试和研究.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.smbey0nd.com/2010/03/13/my_mobile_web_workflow/&quot;&gt;我的Mobile WEB研发流程&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;链接至“手机网站开发必修课[2009总结版]”&quot; rel=&quot;bookmark&quot; href=&quot;http://www.fool2fish.cn/?p=324&quot;&gt;手机网站开发必修课[2009总结版]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.planabc.net/2008/04/17/wap_about_xhtmlmp_and_wcss/&quot;&gt;WAP2.0知识分享PPT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440069/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440069/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440069/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440069/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=303</wfw:commentRss><slash:comments>0</slash:comments><description>交互原则

Strive for consistency.力求一致
Enable frequent users to use shortcuts.允许频繁的使用快捷键
Offer informative feedback.提供明确的反馈
Design dialog to yield closure.设计对话，告诉用户任务已完成
Offer simple error handling.提供错误预防和简单的纠错能力
Permit easy reversal of actions.应该方便用户取消某个操作
Support internal locus of control.用户应掌握控制权
Reduce short-term memory load.减轻用户的记忆负担


尽量减少操作的步骤
尽量利用点击来代替输入
时刻让用户知道自己所处的位置
与web保持一致且数据同步
为输入法让出空间
摘要形式展现信息
导航和提示处于明显的位置
减少滚动

界面简洁的途径：

减少控件的数目，使程序的主功能显然易见，引导用户操作。
当内容过多时，要突出重要信息，便于用户快速浏览。
显示出错信息时，不要只告知用户程序出现错误，要提供有用的信息引导用户完成操作。
手机上网的速度慢，一般在6k/s，这就要求页面的内容尽量精简，避免过多的图片。
页面的内容控制在两屏以内，也不能空白。比如当用户支付电影票之后，不能只显示“支付成功”，可以引导用户使用其他功能。

操作方式
手机操作有物理按键和触摸等多种操作方式，当同样的程序要在多种操作方式下使用，需顾及手指点击时可点区域的大小。使用物理按键时，按钮可以只是两个字，选中控件即可操作，而iPhone的可点击区域最好不低于44×44像素。
分辨率种类（不完全统计）：

128*128  128*160 130*130  176*144  176*220 208*208 208*320  240*160 240*240 240*260
240*320 240*400 240*432 240*480 320*240 320*320 320*400 320*480 345*800 352*416
360*480 360*640 400*800 480*320 480*360
480*640 480*800 480*854 480*864 640*480  800*480

手机浏览器兼容性测试结果概要
注意：以下所说的“大多数”是指在我们测试过的机型中，发生此类状况的手机占比达50%及以上，“部分”为20%到50%；“少数”为20%及以下。而这个概率也仅仅只限于我们所测试过的机型，虽然我们采集的样本尽量覆盖各种特征的手机，但并不代表所有手机的情况。
XHTML部分
大多数手机不支持的：

表单元素的“disable”属性

部分手机不支持的：

“button”标签
“input[type=file]“标签
“iframe”标签。

虽然只有部分手机不支持这几个标签，但因为这些标签在页面中往往具有非常重要的功能，所以属于高危标签，要谨慎使用。
少数手机不支持的：

“select”标签：该标签如果被赋予比较复杂的CSS属性，可能会导致显示不正常，比如”vertical-align:middle”。

CSS部分
大部分手机不支持的：

“font-family”属性：因为手机基本上只安装了宋体这一种中文字体；
“font-family:bold;”：对中文字符无效，但一般对英文字符是有效的；
“font-style: [...]&lt;img src=&quot;http://www1.feedsky.com/t1/463440069/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440069/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440069/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440069/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>XHTML+CSS</category><category>移动平台</category><pubDate>Tue, 11 May 2010 13:48:01 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=303#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=303</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=303</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440069/5589304</fs:itemid></item><item><title>招聘广告一枚</title><link>http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440070/5589304/1/item.html</link><content:encoded>&lt;p&gt;&lt;a href=&quot;http://www.fminutes.com/&quot;&gt;上海五分钟&lt;/a&gt;诚聘前端开发工程师&lt;/p&gt;
&lt;p&gt;职位名称：前端开发工程师&lt;/p&gt;
&lt;p&gt;你有两个方向可供选择：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;平台方向&lt;/strong&gt;&lt;br /&gt;
职位描述&lt;br /&gt;
1. 负责公司各游戏产品的web页面输出及优化；&lt;br /&gt;
2. 能快速处理主流浏览器的兼容性问题（FF/IE6/IE7/IE8/Chrome/Opera）；&lt;br /&gt;
3. 使用Facebook/人人网/opensocial等Javascript API完成相关功能；&lt;br /&gt;
4. 负责公司各管理系统后台界面的输出和Javascript开发；&lt;br /&gt;
&lt;strong&gt;游戏WAP版方向&lt;/strong&gt;&lt;br /&gt;
职位描述&lt;br /&gt;
1.负责游戏wap版的前端开发工作；&lt;br /&gt;
2.保证在各种不同的移动设备中有良好的可用性；&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;职位要求&lt;/strong&gt;&lt;br /&gt;
1.     本科或以上学历，一年以上前端开发相关工作经验，有WAP相关开发经验者优先考虑；&lt;br /&gt;
2.     精通各种Web前端技术，包括XHTML/XML/CSS/Javascript等；&lt;br /&gt;
3.     能熟练使用一门服务器端语言者优先考虑（如Java/PHP/C#/Ruby）；&lt;br /&gt;
4.     有良好的沟通能力，善于和各种背景的人合作；&lt;br /&gt;
5.     理解Web标准，对可用性、可访问性等相关知识有实际的了解。&lt;br /&gt;
6.     关注前端技术发展方向，对HTML5和CSS3有所了解；&lt;br /&gt;
注：简历请附上作品链接,若有技术BLOG，请附上BLOG地址。&lt;/p&gt;
&lt;p&gt;简历请投递：jobs[at]fminutes.com 或   kai.zhang[at]fminutes.com&lt;/p&gt;
&lt;p&gt;加入我们，一起创造快乐！&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.fminutes.com&quot;&gt;上海五分钟&lt;/a&gt;是世界上成长最快、创造性最强的社交游戏公司之一。在这里，你的每一份努力，都会成为全世界玩家的一份快乐！我们可以给你:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;一个开放快乐的环境；&lt;/li&gt;
&lt;li&gt;一个有挑战性的岗位；&lt;/li&gt;
&lt;li&gt;一把潜力巨大的股票；&lt;/li&gt;
&lt;li&gt;一份有竞争力的薪水；&lt;/li&gt;
&lt;li&gt;一段共同奋斗的回忆！&lt;/li&gt;
&lt;/ul&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/463440070/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440070/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440070/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440070/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://playgoogle.com/?feed=rss2&amp;p=286</wfw:commentRss><slash:comments>2</slash:comments><description>上海五分钟诚聘前端开发工程师
职位名称：前端开发工程师
你有两个方向可供选择：
平台方向
职位描述
1. 负责公司各游戏产品的web页面输出及优化；
2. 能快速处理主流浏览器的兼容性问题（FF/IE6/IE7/IE8/Chrome/Opera）；
3. 使用Facebook/人人网/opensocial等Javascript API完成相关功能；
4. 负责公司各管理系统后台界面的输出和Javascript开发；
游戏WAP版方向
职位描述
1.负责游戏wap版的前端开发工作；
2.保证在各种不同的移动设备中有良好的可用性；
职位要求
1.     本科或以上学历，一年以上前端开发相关工作经验，有WAP相关开发经验者优先考虑；
2.     精通各种Web前端技术，包括XHTML/XML/CSS/Javascript等；
3.     能熟练使用一门服务器端语言者优先考虑（如Java/PHP/C#/Ruby）；
4.     有良好的沟通能力，善于和各种背景的人合作；
5.     理解Web标准，对可用性、可访问性等相关知识有实际的了解。
6.     关注前端技术发展方向，对HTML5和CSS3有所了解；
注：简历请附上作品链接,若有技术BLOG，请附上BLOG地址。
简历请投递：jobs[at]fminutes.com 或   kai.zhang[at]fminutes.com
加入我们，一起创造快乐！
上海五分钟是世界上成长最快、创造性最强的社交游戏公司之一。在这里，你的每一份努力，都会成为全世界玩家的一份快乐！我们可以给你:

一个开放快乐的环境；
一个有挑战性的岗位；
一把潜力巨大的股票；
一份有竞争力的薪水；
一段共同奋斗的回忆！&lt;img src=&quot;http://www1.feedsky.com/t1/463440070/PlayGoogleKarry/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/PlayGoogleKarry/~8010025/463440070/5589304/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/PlayGoogleKarry/463440070/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/PlayGoogleKarry/463440070/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>前端开发工程师</category><category>乱七八糟</category><category>招聘</category><pubDate>Thu, 06 May 2010 20:12:32 +0800</pubDate><author>karry</author><comments>http://playgoogle.com/?p=286#comments</comments><guid isPermaLink="false">http://playgoogle.com/?p=286</guid><dc:creator>karry</dc:creator><fs:srclink>http://playgoogle.com/?p=286</fs:srclink><fs:srcfeed>http://playgoogle.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/PlayGoogleKarry/~8010025/463440070/5589304</fs:itemid></item></channel></rss>
