<?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>eddie.Yang's  creative &#187; javascript</title>
	<atom:link href="http://www.ediyang.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ediyang.com</link>
	<description>Creative change lives</description>
	<lastBuildDate>Wed, 14 Jul 2010 02:06:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>提升密码输入框易用性，2个jQuery插件</title>
		<link>http://www.ediyang.com/2-jquery-plugin-improve-password-field-usability/</link>
		<comments>http://www.ediyang.com/2-jquery-plugin-improve-password-field-usability/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 10:02:36 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ediyang.com/?p=778</guid>
		<description><![CDATA[密码输入框，或者说表单是我们普通网民需要经常接触的网页元素之一。但是密码输入框的用户易用性却一直没有没有列入到设计者的考虑中去。
我今天介绍这2个jQuery插件分别是Chroma-Hash以及跟iPhone一样的密码输入框，他们功能不同，但却一样提升了密码输入的易用性。]]></description>
			<content:encoded><![CDATA[<p>密码输入框，或者说表单是我们普通网民需要经常接触的网页元素之一。但是密码输入框的用户易用性却一直没有没有列入到设计者的考虑中去。<br />
我今天介绍这2个jQuery插件分别是<a href="http://mattt.me/2009/07/chroma-hash-a-belated-introduction/">Chroma-Hash</a>以及跟<a href="http://blog.decaf.de/2009/07/iphone-like-password-fields-using-jquery/">iPhone一样的密码输入框</a>，他们功能不同，但却一样提升了密码输入的易用性。</p>
<h3>1.Chroma-Hash</h3>
<p>首先介绍Chroma-Hash，它可以实时用3条色块（可以更多）来形象化你的密码。试试<strong><a href="http://mattt.github.com/Chroma-Hash/">demo演示</a></strong>，或看下图你就明白：<br />
<a href="http://mattt.github.com/Chroma-Hash/"><img class="alignnone size-full wp-image-783" title="chroma-hash" src="http://www.ediyang.com/wp-content/uploads/2009/08/图片-31.png" alt="chroma-hash" width="471" height="252" /></a></p>
<p>可以看到在密码输入框的右边有3个色块表示你的密码，这么做的好处有2个：</p>
<ul>
<li>登录时，用户可以通过颜色判断密码是否输入正确</li>
<li>注册时，用户可以通过对比2次密码输入的色块，判断2个密码是否一致</li>
</ul>
<p>而完成以上步骤是实时完成，更不用通过将数据输送到服务器端，因为用户可以提前知道自己的密码是否有误。</p>
<h4>如何使用</h4>
<p>1.首先到<a href="http://github.com/mattt/Chroma-Hash/tree/master">http://github.com/mattt/Chroma-Hash/tree/master</a>下载<a href="http://mattt.github.com/Chroma-Hash/chroma-hash.js">chroma-hash.js</a><br />
2.html代码如下：</p>
<pre>&lt;fieldset&gt;
&lt;label&gt;Username&lt;/label&gt;
 &lt;input id="username" name="username" type="text" /&gt;
 &lt;label&gt;Password&lt;/label&gt;
 &lt;input id="password" name="password" type="password" /&gt;

 &lt;label&gt;Confirm Password&lt;/label&gt;
 &lt;input id="confirm-password" name="confirm-password" type="password" /&gt;
 &lt;/fieldset&gt;</pre>
<p>2.接着在我们的html 文件中引入jQuery以及chrome-hash.js</p>
<pre><code>
&lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" charset="utf-8"&gt;
 google.load("jquery", "1.3.2");
 &lt;/script&gt;
</code>&lt;script src="chroma-hash.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;</pre>
<p>3.调用函数</p>
<pre><code>
&lt;script type="text/javascript" charset="utf-8"&gt;
$(document).ready(function() {
$("input:password").chromaHash({bars: 3});
$("#username").focus();
});
&lt;/script&gt;
</code></pre>
<p>详细信息可以浏览<a href="http://mattt.me/2009/07/chroma-hash-a-belated-introduction/">作者的网站</a></p>
<h3>2.像iPhone一样的密码输入框</h3>
<p>如果你没有用过iPhone可能并不会明白这个插件的功能，简单的说，就是在密码输入框键入一个字符时它并不会马上变成星号，只有再键入下一个字符时它才会变成星号。<br />
还是看看<a href="http://blog.decaf.de/2009/07/iphone-like-password-fields-using-jquery/">demo演示</a>好了吧，或者看下图：<br />
<a href="http://blog.decaf.de/2009/07/iphone-like-password-fields-using-jquery/"><img class="alignnone size-full wp-image-797" title="iphone-password" src="http://www.ediyang.com/wp-content/uploads/2009/08/iphone-password.jpg" alt="iphone password 提升密码输入框易用性，2个jQuery插件" width="262" height="362" /></a></p>
<p>这样做的好处是：</p>
<ul>
<li>用户可以及时知道自己输错密码</li>
</ul>
<h4>如何使用</h4>
<p>1.到<a href="http://dpassword.googlecode.com/svn/trunk/lib/jQuery.dPassword.js">http://dpassword.googlecode.com/svn/trunk/lib/jQuery.dPassword.js</a>下载jQuery.dPassword.js文件</p>
<p>2.在我们的html文件中引入jQuery与jQuery.dPassword.js并调用</p>
<pre><code>
&lt;script type="text/javascript" src="/js/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/js/jQuery.dPassword.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
	$(document).ready( function() {
		$('input:password').dPassword();
	});
&lt;/script&gt;</code></pre>
<p>详细信息可以浏览<a href="http://blog.decaf.de/2009/07/iphone-like-password-fields-using-jquery/">作者的网站</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ediyang.com/2-jquery-plugin-improve-password-field-usability/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>DD_belatedPNG,解决IE6不支持PNG绝佳方案</title>
		<link>http://www.ediyang.com/dd_belatedpng-best-way-support-ie6-png/</link>
		<comments>http://www.ediyang.com/dd_belatedpng-best-way-support-ie6-png/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 04:53:32 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ediyang.com/?p=575</guid>
		<description><![CDATA[我们知道IE6是不支持透明的PNG的,这无疑限制了网页设计的发挥空间.
然而整个互联网上解决这个IE6的透明PNG的方案也是多不胜数,从使用IE特有的滤镜或是e­xpression,再到javascript+透明GIF替代.但是这些方法都有一个缺点,就是不支持CSS中backgrond-position与background-repeat.]]></description>
			<content:encoded><![CDATA[<p>我们知道IE6是不支持透明的PNG的,这无疑限制了网页设计的发挥空间.<br />
然而整个互联网上解决这个IE6的透明PNG的方案也是多不胜数,从使用IE特有的滤镜或是e­xpression,再到javascript+透明GIF替代.但是这些方法都有一个<strong>缺点</strong>,就是不支持CSS中<strong>backgrond-position</strong>与<strong>background-repeat</strong>.</p>
<p>而我今天介绍DD_belatedPNG,只需要<strong>一个理由</strong>,就是它支持<strong>backgrond-position</strong>与<strong>background-repeat</strong>.这是其他js插件不具备的.同时DD_belatedPNG还支持a:hover属性,以及&lt;img&gt;.</p>
<p><a href="http://www.ediyang.com/demo/DD_Png/">看Demo</a></p>
<h4>原理</h4>
<p>这个js插件使用了微软的VML语言进行绘制,而其他多数解决PNG问题的js插件用的是AlphaImageLoader滤镜.</p>
<h4>使用方法</h4>
<p>1.在<a href="http://dillerdesign.com/experiment/DD_belatedPNG/#download">这里</a>下载DD_belatedPNG.js文件.<br />
2.在网页中引用,如下:</p>
<pre><code>
&lt;!--[if IE 6]&gt;
&lt;script src="DD_belatedPNG.js" mce_src="DD_belatedPNG.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;&lt;!
&lt;!
/* EXAMPLE */
DD_belatedPNG.fix('.png_bg');
/* 将 .png_bg 改成你应用了透明PNG的CSS选择器,例如我例子中的'.trans'*/
// --&gt;
</code></pre>
<p>3.有2种调用函数,一种是DD_belatedPNG.fix(),如上代码.另一种是fix(),这中方法需要在函数内指出css选择器名.</p>
<h4>使用a:hover请留意</h4>
<p><strong>5-25更新:</strong>如果你也像<a href="http://www.jutoy.net/">jutoy</a>同学一样想要用透明PNG作为a:hover时的背景图片,那么你需要留意你的代码,<strong>需要以&#8221;a:hover&#8221;来作为选择器</strong>.否则可能会导致无法成功.同时我也更新了demo,请需要的更新查看.接着我们看看<strong>正确</strong>的代码:</p>
<pre><code>&lt;!--[if IE 6]&gt;
	&lt;script type="text/javascript" src="js/DD_belatedPNG.js" &gt;&lt;/script&gt;
	&lt;script type="text/javascript"&gt;
	DD_belatedPNG.fix('.trans,.box a:hover');
	&lt;/script&gt;
&lt;![endif]--&gt;</code></pre>
<h4>其他方案</h4>
<p>在这里还是提供其他方案供大家参考.尽管我觉得DD_belatedPNG最好</p>
<ul>
<li><a href="http://unitinteractive.com/labs/unitpngfix.php">Unit PNG Fix</a></li>
<li><a href="http://unitinteractive.com/labs/unitpngfix.php">ie7-js</a></li>
<li><a href="http://www.twinhelix.com/css/iepngfix/">IE PNG Fix</a></li>
</ul>
<p>最近我还发现一些很不错很好玩的jQuery插件,接下来也会陆续介绍给大家使用.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ediyang.com/dd_belatedpng-best-way-support-ie6-png/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->