<?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; jquery</title>
	<atom:link href="http://www.ediyang.com/tag/jquery/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>jQuery制作淡入淡出的网站导航栏</title>
		<link>http://www.ediyang.com/jquery-fade-in-and-out-menu/</link>
		<comments>http://www.ediyang.com/jquery-fade-in-and-out-menu/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 17:37:29 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[headline]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://www.ediyang.com/?p=441</guid>
		<description><![CDATA[前些天有朋友问我关于如何用jQuery制作淡入淡出的效果,就像本网上方的导航栏一样的效果.
借助jQuery的帮助,我们只需要几行代码就可以实现这样的效果.
当然这样的效果不止可以用来制作网站导航栏,同时也可以用来用在其他有鼠标悬停的地方.这就需要发挥各位的想象力了.
]]></description>
			<content:encoded><![CDATA[<p>前些天有朋友问我关于如何用<a href="http://www.jquery.com">jQuery</a>制作淡入淡出的效果,就像<a href="http://www.ediyang.com">本网</a>上方的导航栏一样的效果.<br />
借助jQuery的帮助,我们只需要几行代码就可以实现这样的效果.<br />
当然这样的效果不止可以用来制作网站导航栏,同时也可以用来用在其他有鼠标悬停的地方.这就需要发挥各位的想象力了.</p>
<p><a href="http://www.ediyang.com/demo/jqueryFadeMenu/">在线DEMO</a><br />
<a href="http://www.ediyang.com/wp-content/uploads/2009/03/jqueryFadeMenu.rar">下载源文件</a></p>
<h3>XHTML的代码</h3>
<p>首先,我们需要在之间把jQuery引用进来,这里我们使用Google CDN提供的jQuery.</p>
<pre><code>

&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>
<p>首先让我们看看本例子中用做导航栏的背景图片<br />
<img class="alignnone size-full wp-image-443" title="nav" src="http://www.ediyang.com/wp-content/uploads/2009/03/nav.gif" alt="nav jQuery制作淡入淡出的网站导航栏" width="500" height="104" /><br />
每个按钮的尺寸都是一样大:125*52px.<br />
<img class="alignnone size-full wp-image-442" title="jfm" src="http://www.ediyang.com/wp-content/uploads/2009/03/jfm.gif" alt="jfm jQuery制作淡入淡出的网站导航栏" width="150" height="70" /><br />
接下来我们要看看导航栏的代码,这里我使用ul来进行布局(较常用的方法),代码如下:</p>
<pre><code>
&lt;ul class="nav"&gt;
	&lt;li class="home"&gt;&lt;a href="#"&gt;主页&lt;/a&gt;&lt;div class="hoverHome"&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li class="work"&gt;&lt;a href="#"&gt;作品&lt;/a&gt;&lt;div class="hoverWOrk"&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li class="about"&gt;&lt;a href="#"&gt;关于&lt;/a&gt;&lt;div class="hoverAbout"&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li class="contact"&gt;&lt;a href="#"&gt;联系&lt;/a&gt;&lt;div class="hoverContact"&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<p>各位可以看到每个li中还包含了</p>
<p>这样的空div,而这个空div就是本例子中用于鼠标悬停时显示的div.在后面我们可以看到它的作用.继续..</p>
<h3>CSS的代码</h3>
<pre><code>
ul.nav{
	height:52px;
	text-indent:-9999px;
	list-style:none;
	}
</code></pre>
<p>这里text-indent:-9999px;是把xhtml里的文字缩进到我们看不到的地方.</p>
<pre><code>
ul.nav li{
	float:left;
	position:relative;
	}
</code></pre>
<p>注意这里position:relative;的设置是为了hoverHome等层进行相对定位做准备.</p>
<pre><code>
ul.nav a{
	display:block;
	width:125px;
	height:52px;
	}
</code></pre>
<p>这里把宽度与高度设置为按钮的尺寸,即125*52px.</p>
<pre><code>
.hoverHome,.hoverWork,.hoverAbout,.hoverContact{
	position:absolute;
	top:0;
	left:0;
	width:125px;
	height:52px;
	cursor:pointer;
	}
</code></pre>
<p>CSS部分的重点就在这,使用position:absolute;后这4个层就会以ul.nav li为基点进行定位,这里我们需要让.hoverHome,.hoverWork,.hoverAbout,.hoverContact这4个div与每个li完全重叠,所以我们设置top与left都为0.<br />
接下来我们定义导航栏的背景图片</p>
<pre><code>
.home a{
	background:url(images/nav.gif) no-repeat 0 0;
	}
.work a{
	background:url(images/nav.gif) no-repeat -125px 0;
	}
.about a{
	background:url(images/nav.gif) no-repeat -250px 0;
	}
.contact a{
	background:url(images/nav.gif) no-repeat -375px 0;
	}
</code></pre>
<p>我们会特别注意到背景图片的偏移位置.例如“home”的背景图片在距离左边0px,距离上边0. 而第2个按钮&#8221;work&#8221;距离左边125px,所以我们设置为-125px(记住是负号).距离上边为0;以此类推.</p>
<pre><code>
.hoverHome{
	background:url(images/nav.gif) no-repeat 0 -52px;
	}
.hoverWork{
	background:url(images/nav.gif) no-repeat -125px -52px;
	}
.hoverAbout{
	background:url(images/nav.gif) no-repeat -250px -52px;
	}
.hoverContact{
	background:url(images/nav.gif) no-repeat -375px -52px;
	}
</code></pre>
<p>这里我们依然用的是同一张背景图片,而我们这一次需要的是图片下方蓝色的部分,也就是距离上边52px的线以下的部分.所以我们看到每个层的背景图偏移位置第2个属性都是-52px,这就让背景图从距上边52px的地方开始.</p>
<p>现在刷新你的页面,如果你的代码没错,你应该可以看到一条蓝色的导航栏了.但是它没有任何鼠标悬停的变动效果.没有淡入淡出,轮到jQuery出场了.</p>
<h3>jQuery代码</h3>
<p>请依然把代码写在&lt;head&gt;里面.</p>
<pre><code>
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
		$(".hoverHome,.hoverWork,.hoverAbout,.hoverContact").css("opacity","0");
		$(".hoverHome,.hoverWork,.hoverAbout,.hoverContact").hover(function () {
			$(this).stop().animate({
				opacity: 1
			}, "slow");
		},
		function () {
			$(this).stop().animate({
				opacity: 0
			}, "slow");
		});
		});
&lt;/</code>script&gt;</pre>
<p>这段代码很容易理解,首先把.hoverHome,.hoverWork,.hoverAbout,.hoverContact这4个层设置透明度opacity为0,即隐藏.接着当鼠标悬停在按钮上时,我们再将这4个层以淡入的效果显示出来,而当把鼠标移开时,这4个层就淡出.</p>
<h4>总结一下</h4>
<p>这个例子中的代码都很好理解,其核心就是利用jQuery中的animate()函数以淡入淡出的效果改变div的css属性.<a href="http://www.ediyang.com/new-jquery-v13-api-browser-and-air-edition/">参考jQuery API关于animate的使用方法</a>.而CSS最需要留意的就是position:relative与Position:absolute的位置.<br />
好吧,对于jQuery与Javascript这方面我也是一个小小的<a href="http://www.ediyang.com/about">菜鸟</a>,经常都是看看别人的代码然后自己胡乱写,所以如果你有更好的方法,请你留言给我,同时也帮助其他看到这篇文章的朋友呵呵.谢谢</p>
<p>最后呼吁一下转载的朋友,请尊重本人的劳动成果,留一个小小的链接给我.谢谢！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ediyang.com/jquery-fade-in-and-out-menu/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>jQuery 1.3新版API浏览器,包括Adobe AIR离线版</title>
		<link>http://www.ediyang.com/new-jquery-v13-api-browser-and-air-edition/</link>
		<comments>http://www.ediyang.com/new-jquery-v13-api-browser-and-air-edition/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 15:55:16 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.ediyang.com/?p=317</guid>
		<description><![CDATA[jQuery在推出jQuery 1.3的同时也向外界正式展示了全新制作的API浏览器，这使得我们查阅jQuery相关函数与应用更加方便.同时带给大家1.3版的中文版使用手册.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.com/">jQuery</a>在推出jQuery 1.3的同时也向外界正式展示了全新制作的API浏览器，这使得我们查阅jQuery相关函数与应用更加方便.<br />
访问新版API: <a href="http://api.jquery.com/">http://api.jquery.com/</a><br />
同时jQuery也推出了API的<a href="http://www.adobe.com/products/air/">Adobe AIR</a>离线版,你需要先<a href="http://get.adobe.com/cn/air/">下载并安装AIR</a>,然后再<a href="http://api.jquery.com/">下载离线版API</a>进行安装.<br />
AIR离线版的jQuery API功能与在线版几乎一样,菜单滑动效果也很好(得益于AIR).如果你的网速较慢,使用AIR版API是比较好的选择.<br />
<img src="http://www.ediyang.com/wp-content/uploads/2009/03/jqapi01.jpg" alt="jqapi01 jQuery 1.3新版API浏览器,包括Adobe AIR离线版" title="jqapi01" width="500" height="362" class="alignnone size-full wp-image-319" /><br />
根据jQuery官方Blog描述,新版API浏览器有以下特性：<br />
  1.最新的jQuery与jQuery UI使用文档<br />
  2.可以标示为“favourite”以便以后回访<br />
  3.实例中代码高亮<br />
  4.在浏览器中实时运行<br />
  5.可以对实例进行编辑及试验</p>
<p>如果你比较倾向于阅读汉字,虽然没有官方的中文API,但是我们仍然可以从<a href="http://code.google.com/p/jquery-api-zh-cn/">jQueryAPI参考文档中文版翻译</a>下载到jQuery 1.3 API的CHM电子书.<br />
<img src="http://www.ediyang.com/wp-content/uploads/2009/03/jqapi02.jpg" alt="jqapi02 jQuery 1.3新版API浏览器,包括Adobe AIR离线版" title="jqapi02" width="534" height="251" class="alignnone size-full wp-image-318" /></p>
<p>希望以上信息对喜欢jQuery的同学有帮助.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ediyang.com/new-jquery-v13-api-browser-and-air-edition/feed/</wfw:commentRss>
		<slash:comments>2</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! -->