<?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>Flex Home &#187; jQuery</title>
	<atom:link href="http://flex.desizen.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.desizen.com</link>
	<description>又一个 flex 博客</description>
	<lastBuildDate>Thu, 01 Dec 2011 03:33:47 +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>jQuery插件:fancybox</title>
		<link>http://flex.desizen.com/jquery-plugin-fancybox/</link>
		<comments>http://flex.desizen.com/jquery-plugin-fancybox/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 02:38:23 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=252</guid>
		<description><![CDATA[它是什么? fancybox 是一个 MAC 风格的用来在 web 页面显示图片, html 内容和多媒体的 “lightbox(灯箱)” 工具,是一个比较轻量的 jQuery 插件,所以使用 jQuery library ,遵守 MIT License. 特点: 增加了一个漂亮的阴影背景 增加了一个相关列表的导航功能,也就是可以展示一组图片或 html 内容 可以显示图片, 内嵌多媒体, AJAX 以及 iframe 内容 通过设置 CSS 样式实现可定制化 支持使用这个 easing plugin 插件 下载 当前版本: v.1.2.1 地址: Google code 在 FireFox, Safari,  Opera,   IE6 &#38; IE7 浏览器上测试成功通过. 效果 点击查看 使用方法 首先,要确保你添加了 DOCTYPE,  [...]]]></description>
			<content:encoded><![CDATA[<h2>它是什么?</h2>
<p><a href="http://fancybox.net/home" target="_blank">fancybox</a> 是一个 MAC 风格的用来在 web 页面显示图片, html 内容和多媒体的 “lightbox(灯箱)” 工具,是一个比较轻量的 jQuery 插件,所以使用 <a href="http://jquery.com/" target="_blank">jQuery library</a> ,遵守 <a href="http://en.wikipedia.org/wiki/MIT_License" target="_blank">MIT License</a>.</p>
<p><strong>特点:</strong><span id="more-252"></span></p>
<ul>
<li>增加了一个漂亮的阴影背景</li>
<li>增加了一个相关列表的导航功能,也就是可以展示一组图片或 html 内容</li>
<li>可以显示图片, 内嵌多媒体, AJAX 以及 iframe 内容</li>
<li>通过设置 CSS 样式实现可定制化</li>
<li>支持使用这个 <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">easing plugin</a> 插件</li>
</ul>
<h2>下载</h2>
<p>当前版本: <span>v.1.2.1</span></p>
<p>地址: <a href="http://code.google.com/p/fancybox/downloads/detail?name=jquery.fancybox-1.2.1.zip" target="_blank">Google code</a></p>
<p>在 FireFox, Safari,  Opera,   IE6 &amp; IE7 浏览器上测试成功通过.</p>
<h2>效果</h2>
<p><a href="http://fancybox.net/example" target="_blank">点击查看</a></p>
<h2>使用方法</h2>
<p>首先,要确保你添加了 <a href="http://www.alistapart.com/articles/doctype/" target="_blank">DOCTYPE</a>,  这是用来确保CSS样式可以正常显示.</p>
<p><strong>1. 包含需要的 JS 文件</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;path-to-file/jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;script src=&quot;path-to-file/jquery.fancybox.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;</pre></div></div>

<p>选择性的添加 easing 插件所需的 js 文件, 如果不使用该插件就不添加.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;path-to-file/jquery.easing.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:2--&gt;&lt;/script&gt;</pre></div></div>

<p><strong>2. 添加 FancyBox CSS 文件</strong><br />
如果 FancyBox CSS 文件没有和 images 目录在同一目录内, 应该改变图片路径</p>
<p><strong>3. 创建一个链接</strong><br />
加载图片使用:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a id=&quot;single_image&quot; href=&quot;image_big.jpg&quot;&gt;&lt;img src=&quot;image_small.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;</pre></div></div>

<p>加载同一页面中的 element:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a id=&quot;inline&quot; href=&quot;#data&quot;&gt;This shows content of element who has id=&quot;data&quot;&lt;/a&gt;</pre></div></div>

<p>Iframe方式:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;http://www.example?iframe&quot;&gt;This goes to iframe&lt;/a&gt;
 or
&lt;a class=&quot;iframe&quot; href=&quot;http://www.example&quot;&gt;This goes to iframe&lt;/a&gt;</pre></div></div>

<p>Ajax:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;http://www.example/data.php&quot;&gt;This takes content using ajax&lt;/a&gt;</pre></div></div>

<p><strong>可选参数:</strong>使用<em>title</em>属性可以增加图片说明文字.<br />
<strong>注意:</strong>你或许想要删除<strong>点击图片关闭展示</strong>这个功能,此时你必须使用 Iframe 或者 inline 方式去加载.</p>
<p><strong>4. 使用 jQuery 选择器, 让插件炫起来 </strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$(document).ready(function() { 
    /* This is basic - uses default settings */ 
&nbsp;
    $(&quot;a#single_image&quot;).fancybox(); 
&nbsp;
    /* Using custom settings */ 
&nbsp;
    $(&quot;a#inline&quot;).fancybox({ 
        'hideOnContentClick': true 
    }); 
&nbsp;
    $(&quot;a.group&quot;).fancybox({ 
        'zoomSpeedIn': 300, 
        'zoomSpeedOut': 300, 
        'overlayShow': false 
    }); 
});</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-plugin-fancybox/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 表单过滤(Form Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-formfilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-formfilters/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 01:48:36 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Form Filters]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=196</guid>
		<description><![CDATA[本文是jQuery选择器系列之表单过滤(Form Filters). 表单过滤(Form Filters)是jQuery文档中分出来的选择器中的最后一组,但这并不表示我们仅仅应用这些选择器就能够驰骋DOM海洋了,我们还需要学习后面的过滤器等等. 其包括以下几个选择器: :enabled :disabled :checked :selected :enabled 用法: $(“input:enabled”) ; 说明: 匹配所有可用元素.意思是查找所有input中不带有disabled=”disabled”的input.不为disabled,当然就为enabled啦. :disabled 用法: $(“input:enabled”) ; 说明: 匹配所有不可用元素.与上面的那个是相对应的. :checked 用法: $(“input:checked”) ; 说明: 匹配所有选中的被选中元素(复选框、单选框等，不包括select中的option).这话说起来有些绕口. :selected 用法: $(“select option:selected”) ; 说明: 匹配所有选中的option元素.]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-formfilters/">表单过滤(Form Filters)</a>.</p>
<p><strong>表单过滤(Form Filters)</strong>是jQuery文档中分出来的选择器中的最后一组,但这并不表示我们仅仅应用这些选择器就能够驰骋DOM海洋了,我们还需要学习后面的过滤器等等.<span id="more-196"></span></p>
<p>其包括以下几个选择器:</p>
<ul>
<li><a href="#u_a">:enabled</a></li>
<li><a href="#u_b">:disabled</a></li>
<li><a href="#u_c">:checked</a></li>
<li><a href="#u_d">:selected</a></li>
</ul>
<p><strong id="u_a">:enabled</strong><br />
用法: <em>$(“input:enabled”) ;</em><br />
说明: 匹配所有可用元素.意思是查找所有input中不带有disabled=”disabled”的input.不为disabled,当然就为enabled啦.</p>
<p><strong id="u_b">:disabled</strong><br />
用法: <em>$(“input:enabled”) ;</em><br />
说明: 匹配所有不可用元素.与上面的那个是相对应的.</p>
<p><strong id="u_c">:checked</strong><br />
用法: <em>$(“input:checked”) ;</em><br />
说明: 匹配所有选中的被选中元素(复选框、单选框等，不包括select中的option).这话说起来有些绕口.</p>
<p><strong id="u_d">:selected</strong><br />
用法: <em>$(“select option:selected”) ;</em><br />
说明: 匹配所有选中的option元素.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-formfilters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 表单(Forms)</title>
		<link>http://flex.desizen.com/jquery-selectors-forms/</link>
		<comments>http://flex.desizen.com/jquery-selectors-forms/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 03:13:06 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=189</guid>
		<description><![CDATA[本文是jQuery选择器系列之表单(Forms). 这组表单(Forms)选择器内容稍稍多了点,有十一个,其实也就是input的那些type啦,但是熟悉html的童鞋快速的掌握这些一点问题都没有! 其包括以下几个选择器: :input :text :password :radio :checkbox :submit :image :reset :button :file :hidden :input 用法: $(“:input”) ; 说明: 这个自然就是选择所有的input类型了,不管type等于何值(首先得是符合游戏规则的). :text 用法: $(“:text”) ; 说明: 匹配所有的单行文本框. :password 用法: $(“:password”) ; 说明: 匹配所有密码框. :radio 用法: $(“:radio”) ; 说明: 匹配所有单选按钮. :checkbox 用法: $(“:checkbox”) ; 说明: 匹配所有复选框 :submit 用法: $(“:submit”) ; 说明: 匹配所有提交按钮. :image 用法: $(“:image”) ; 说明: [...]]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-forms/">表单(Forms)</a>.</p>
<p>这组<strong>表单(Forms)</strong>选择器内容稍稍多了点,有十一个,其实也就是input的那些type啦,但是熟悉html的童鞋快速的掌握这些一点问题都没有!<span id="more-189"></span></p>
<p>其包括以下几个选择器:</p>
<ul>
<li><a href="#u_a">:input</a></li>
<li><a href="#u_b">:text</a></li>
<li><a href="#u_c">:password</a></li>
<li><a href="#u_d">:radio</a></li>
<li><a href="#u_e">:checkbox</a></li>
<li><a href="#u_f">:submit</a></li>
<li><a href="#u_g">:image</a></li>
<li><a href="#u_h">:reset</a></li>
<li><a href="#u_i">:button</a></li>
<li><a href="#u_j">:file</a></li>
<li><a href="#u_k">:hidden</a></li>
</ul>
<p><strong id="u_a">:input</strong><br />
用法: <em>$(“:input”) ;</em><br />
说明: 这个自然就是选择所有的input类型了,不管type等于何值(首先得是符合游戏规则的).</p>
<p><strong id="u_b">:text</strong><br />
用法: <em>$(“:text”) ;</em><br />
说明: 匹配所有的单行文本框.</p>
<p><strong id="u_c">:password</strong><br />
用法: <em>$(“:password”) ;</em><br />
说明: 匹配所有密码框.</p>
<p><strong id="u_d">:radio</strong><br />
用法: <em>$(“:radio”) ;</em><br />
说明: 匹配所有单选按钮.</p>
<p><strong id="u_e">:checkbox</strong><br />
用法: <em>$(“:checkbox”) ;</em><br />
说明: 匹配所有复选框</p>
<p><strong id="u_f">:submit</strong><br />
用法: <em>$(“:submit”) ;</em><br />
说明: 匹配所有提交按钮.</p>
<p><strong id="u_g">:image</strong><br />
用法: <em>$(“:image”) ;</em><br />
说明: 匹配所有图像域.</p>
<p><strong id="u_h">:reset</strong><br />
用法: <em>$(“:reset”) ;</em><br />
说明: 匹配所有重置按钮.</p>
<p><strong id="u_i">:button</strong><br />
用法: <em>$(“:button”) ;</em><br />
说明: 匹配所有按钮.这个包括直接写的元素button.</p>
<p><strong id="u_j">:file</strong><br />
用法: <em>$(“:file”) ;</em><br />
说明: 匹配所有文件域.</p>
<p><strong id="u_k">:hidden</strong><br />
用法: <em>$(“input:hidden”) ;</em><br />
说明: 匹配所有不可见元素，或者type为hidden的元素.这个选择器就不仅限于表单了,除了匹配input中的hidden外,那些style为hidden的也会被匹配.<br />
<strong>注意:</strong> 要选取input中为hidden值的方法就是上面例子的用法,但是直接使用 “:hidden” 的话就是匹配页面中所有的不可见元素,包括宽度或高度为0的,看个例子:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; 
                    &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&nbsp;
  &lt;script&gt;
  $(document).ready(function(){
&nbsp;
    // in some browsers :hidden includes head, title, script, etc... so limit to body
    $(&quot;span:first&quot;).text(&quot;Found &quot; + $(&quot;:hidden&quot;, document.body).length + 
                         &quot; hidden elements total.&quot;);
    $(&quot;div:hidden&quot;).show(3000);
    $(&quot;span:last&quot;).text(&quot;Found &quot; + $(&quot;input:hidden&quot;).length + &quot; hidden inputs.&quot;);
&nbsp;
  });
  &lt;/script&gt;
  &lt;style&gt;
  div { width:70px; height:40px; background:#ee77ff; margin:5px; float:left; }
  span { display:block; clear:left; color:red; }
  .starthidden { display:none; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div style=&quot;display:none;&quot;&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div class=&quot;starthidden&quot;&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;form&gt;
    &lt;input type=&quot;hidden&quot; /&gt;
    &lt;input type=&quot;hidden&quot; /&gt;
    &lt;input type=&quot;hidden&quot; /&gt;
  &lt;/form&gt;
  &lt;span&gt;
  &lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>在这里,大家需要仔细数一数那个个数.这个改变是从1.3.2开始的.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 后代过滤(Child Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-childfilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-childfilters/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 16:13:51 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Child Filters]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=176</guid>
		<description><![CDATA[本文是jQuery选择器系列之后代过滤(Child Filters). 后代过滤(Child Filters)的意思就是利用其他jQuery选择器选择到了一组dom,而其都具有相同的属性与特征,无法再细化选择的时候,Child Filters 此时就派上了用场了.它就是用来选择此组元素中的第几个. 其包括以下几个选择器: :nth-child(index/even/odd/equation) :first-child :last-child : only-child :nth-child(index/even/odd/equation) 用法: $(“ul li:nth-child(2)”) ; 说明: 匹配其父元素下的第N个子或奇偶元素.这个选择器和之前说的基础过滤(Basic Filters)中的 eq() 有些类似,不同的地方就是前者是从0开始,后者是从1开始. :first-child 用法: $(“ul li:first-child”) ; 说明: 匹配第一个子元素.&#8217;:first&#8217; 只匹配一个元素,而此选择符将为每个父元素匹配一个子元素.这里需要特别点的记忆下区别. :last-child 用法: $(“ul li:last-child”) ; 说明: 匹配最后一个子元素.&#8217;:last&#8217;只匹配一个元素,而此选择符将为每个父元素匹配一个子元素. : only-child 用法: $(“ul li:only-child”) ; 说明: 如果某个元素是父元素中唯一的子元素,那将会被匹配.如果父元素中含有其他元素,那将不会被匹配.意思就是:只有一个子元素的才会被匹配!]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-childfilters/">后代过滤(Child Filters)</a>.</p>
<p><strong>后代过滤(Child Filters)</strong>的意思就是利用其他jQuery选择器选择到了一组dom,而其都具有相同的属性与特征,无法再细化选择的时候,Child Filters 此时就派上了用场了.它就是用来选择此组元素中的第几个.<span id="more-176"></span></p>
<p>其包括以下几个选择器:</p>
<ul>
<li><a href="#u_a">:nth-child(index/even/odd/equation)</a></li>
<li><a href="#u_b">:first-child</a></li>
<li><a href="#u_c">:last-child</a></li>
<li><a href="#u_d">: only-child</a></li>
</ul>
<p><strong id="u_a">:nth-child(index/even/odd/equation)</strong><br />
用法: <em>$(“ul li:nth-child(2)”) ;</em><br />
说明: 匹配其父元素下的第N个子或奇偶元素.这个选择器和之前说的<a href="http://flex.joelove.cn/jquery-selectors-basicfilters/#u_f">基础过滤(Basic Filters)</a>中的 eq() 有些类似,不同的地方就是前者是从0开始,后者是从1开始.</p>
<p><strong id="u_b">:first-child</strong><br />
用法: <em>$(“ul li:first-child”) ;</em><br />
说明: 匹配第一个子元素.&#8217;:first&#8217; 只匹配一个元素,而此选择符将为每个父元素匹配一个子元素.这里需要特别点的记忆下区别.</p>
<p><strong id="u_c">:last-child</strong><br />
用法: <em>$(“ul li:last-child”) ;</em><br />
说明: 匹配最后一个子元素.&#8217;:last&#8217;只匹配一个元素,而此选择符将为每个父元素匹配一个子元素.</p>
<p><strong id="u_d">: only-child</strong><br />
用法: <em>$(“ul li:only-child”) ;</em><br />
说明: 如果某个元素是父元素中唯一的子元素,那将会被匹配.如果父元素中含有其他元素,那将不会被匹配.意思就是:只有一个子元素的才会被匹配!</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-childfilters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 属性过滤(Attribute Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-attributefilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-attributefilters/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 05:55:15 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Attribute Filters]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=160</guid>
		<description><![CDATA[本文是jQuery选择器系列之属性过滤(Attribute Filters). 属性过滤(Attribute Filters)的内容就是html元素中的属性,例如 name, id, class, 但是不是指的其值,是指属性本身.我在每篇文章里面都讲一下自己对这个选择器系列的理解,原因其一是方便理解其含义并记忆,其二就是”混个脸熟”,即便记不住,在以后用到的时候也可以很快的查找api并应用上. 其包括以下几个选择器: [attribute] [attribute=value] [attribute!=value] [attribute^=value] [attribute$=value] [attribute*=value] [attributeFilter1][attributeFilter2][attributeFilterN] [attribute] 用法: $(“div[id]“) ; 说明: 匹配包含给定属性的元素.注意,在jQuery 1.3中,前导的@符号已经被废除!如果想要兼容最新版本,只需要简单去掉@符号即可.是的,新版必须去掉@符号,这个改变相信使用老版本的童鞋会习惯的.例子中是选取了所有带”id”属性的div标签. [attribute=value] 用法: $(“input[name='newsletter']“).attr(“checked”, true); 说明: 匹配给定的属性是某个特定值的元素.例子中选取了所有 name 属性是 newsletter 的 input 元素. [attribute!=value] 用法: $(“input[name!='newsletter']“).attr(“checked”, true); 说明: 匹配所有不含有指定的属性，或者属性不等于特定值的元素.此选择器等价于:not([attr=value]),要匹配含有特定属性但不等于特定值的元素,请使用[attr]:not([attr=value]).嗯,之前看到的 :not 派上了用场. [attribute^=value] 用法: $(“input[name^='news']“) ; 说明: 匹配给定的属性是以某些值开始的元素.嗯,我们又见到了这几个类似于正则匹配的符号.现在想忘都忘不掉了吧?! [attribute$=value] 用法: $(“input[name$='letter']“) ; 说明: 匹配给定的属性是以某些值结尾的元素. [...]]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-attributefilters/">属性过滤(Attribute Filters)</a>.</p>
<p><strong>属性过滤(Attribute Filters)</strong>的内容就是html元素中的属性,例如 name, id, class, 但是不是指的其值,是指属性本身.我在每篇文章里面都讲一下自己对这个选择器系列的理解,原因其一是方便理解其含义并记忆,其二就是”混个脸熟”,即便记不住,在以后用到的时候也可以很快的查找api并应用上.<span id="more-160"></span></p>
<p>其包括以下几个选择器:</p>
<ul>
<li><a href="#u_a">[attribute]</a></li>
<li><a href="#u_b">[attribute=value]</a></li>
<li><a href="#u_c">[attribute!=value]</a></li>
<li><a href="#u_d">[attribute^=value]</a></li>
<li><a href="#u_e">[attribute$=value]</a></li>
<li><a href="#u_f">[attribute*=value]</a></li>
<li><a href="#u_g">[attributeFilter1][attributeFilter2][attributeFilterN]</a></li>
</ul>
<p><strong id="u_a">[attribute]</strong><br />
用法: <em>$(“div[id]“) ;</em><br />
说明: 匹配包含给定属性的元素.注意,在jQuery 1.3中,前导的@符号已经被废除!如果想要兼容最新版本,只需要简单去掉@符号即可.是的,新版必须去掉@符号,这个改变相信使用老版本的童鞋会习惯的.例子中是选取了所有带”id”属性的div标签.</p>
<p><strong id="u_b">[attribute=value]</strong><br />
用法: <em>$(“input[name='newsletter']“).attr(“checked”, true); </em><br />
说明: 匹配给定的属性是某个特定值的元素.例子中选取了所有 name 属性是 newsletter 的 input 元素.</p>
<p><strong id="u_c">[attribute!=value]</strong><br />
用法: <em>$(“input[name!='newsletter']“).attr(“checked”, true); </em><br />
说明: 匹配所有不含有指定的属性，或者属性不等于特定值的元素.此选择器等价于:not([attr=value]),要匹配含有特定属性但不等于特定值的元素,请使用[attr]:not([attr=value]).嗯,之前看到的 :not 派上了用场.</p>
<p><strong id="u_d">[attribute^=value]</strong><br />
用法: <em>$(“input[name^='news']“) ;</em><br />
说明: 匹配给定的属性是以某些值开始的元素.嗯,我们又见到了这几个类似于正则匹配的符号.现在想忘都忘不掉了吧?!</p>
<p><strong id="u_e">[attribute$=value]</strong><br />
用法: <em>$(“input[name$='letter']“) ;</em><br />
说明: 匹配给定的属性是以某些值结尾的元素.</p>
<p><strong id="u_f">[attribute*=value]</strong><br />
用法: <em>$(“input[name*='man']“) ;</em><br />
说明: 匹配给定的属性是以包含某些值的元素.</p>
<p><strong id="u_g">[attributeFilter1][attributeFilter2][attributeFilterN]</strong><br />
用法: <em>$(“input[id][name$='man']“) ;</em><br />
说明: 复合属性选择器,需要同时满足多个条件时使用.又是一个组合,这种情况我们实际使用的时候很常用.这个例子中选择的是所有含有 id 属性,并且它的 name 属性是以 man 结尾的元素.</p>
<p>通过属性过滤(Attribute Filters)的学习,可以看出来,jQuery的选择器用法是微妙的,得细致而为之.让我想起来了那个因为一个小数点导致什么宇宙飞船爆炸还是什么的事了.有点耸人听闻,但是等我们使用的非常非常多了以后,自然就很容易分开区别了.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-attributefilters/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 – 可见度过滤(Visibility Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-visibilityfilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-visibilityfilters/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 06:15:13 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Selectors]]></category>
		<category><![CDATA[Visibility Filters]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=151</guid>
		<description><![CDATA[本文是jQuery选择器系列之可见度过滤(Visibility Filters). 可见度过滤(Visibility Filters),无非就是能看见和不能看见.所以Visibility Filters只包括了两部分: :hidden :visible :hidden 用法: $(“tr:hidden”) 说明: 匹配所有的不可见元素，input 元素的 type 属性为 “hidden” 的话也会被匹配到.意思是css中display:none和input type=”hidden”的都会被匹配到.同样,要在脑海中彻底分清楚冒号”:”, 点号”.”和逗号”,”的区别. :visible 用法: $(“tr:visible”) 说明: 匹配所有的可见元素.]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-visibilityfilter/">可见度过滤(Visibility Filters)</a>.</p>
<p><strong>可见度过滤(Visibility Filters)</strong>,无非就是能看见和不能看见.所以Visibility Filters只包括了两部分:<span id="more-151"></span></p>
<ul>
<li><a href="#u_a">:hidden</a></li>
<li><a href="#u_b">:visible</a></li>
</ul>
<p><strong id="u_a">:hidden</strong><br />
用法: <em>$(“tr:hidden”) </em><br />
说明: 匹配所有的不可见元素，input 元素的 type 属性为 “hidden” 的话也会被匹配到.意思是css中display:none和input type=”hidden”的都会被匹配到.同样,要在脑海中彻底分清楚冒号”:”, 点号”.”和逗号”,”的区别.</p>
<p><strong id="u_b">:visible</strong><br />
用法: <em>$(“tr:visible”) </em><br />
说明: 匹配所有的可见元素.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-visibilityfilters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 – 内容过滤(Content Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-contentfilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-contentfilters/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 04:46:03 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Content Filters]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=145</guid>
		<description><![CDATA[本文是jQuery选择器系列之内容过滤(Content Filters). 对于jQuery的学习,最好的办法就是实际使用它,并多多的使用!不然很快就会忘记的. :contains(text) :empty :has(selector) :parent :contains(text) 用法: $(“div:contains(&#8216;John&#8217;)”) ; 说明: 匹配包含给定文本的元素.这个选择器比较有用(话说都很有用),当我们要选择的不是dom标签元素时,它就派上了用场了,它的作用是查找被标签”围”起来的文本内容是否符合指定的内容的. :empty 用法: $(“td:empty”) ; 说明: 匹配所有不包含子元素或者文本的空元素.嗯,这个看名字就大概知道是什么意思了,就是元素里面没有任何东西(子元素/内容)的时候就匹配. :has(selector) 用法: $(“div:has(p)”).addClass(“test”) ; 说明: 匹配含有选择器所匹配的元素的元素.这个解释需要好好琢磨,但是一旦看了使用的例子就完全清楚了:给所有包含p元素的div标签加上class=”test”. :parent 用法: $(“td:parent”) ; 说明: 匹配含有子元素或者文本的元素.注意:这里是”:parent”,可不是”.parent”哦!感觉与上面讲的”:empty”形成反义词.]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-contentfilters/">内容过滤(Content Filters)</a>.</p>
<p>对于jQuery的学习,最好的办法就是实际使用它,并多多的使用!不然很快就会忘记的.<span id="more-145"></span></p>
<ul>
<li><a href="#u_a">:contains(text)</a></li>
<li><a href="#u_b">:empty</a></li>
<li><a href="#u_c">:has(selector)</a></li>
<li><a href="#u_d">:parent</a></li>
</ul>
<p><strong id="u_a">:contains(text)</strong><br />
用法: <em>$(“div:contains(&#8216;John&#8217;)”) ;</em><br />
说明: 匹配包含给定文本的元素.这个选择器比较有用(话说都很有用),当我们要选择的不是dom标签元素时,它就派上了用场了,它的作用是查找被标签”围”起来的文本内容是否符合指定的内容的.</p>
<p><strong id="u_b">:empty</strong><br />
用法: <em>$(“td:empty”) ;</em><br />
说明: 匹配所有不包含子元素或者文本的空元素.嗯,这个看名字就大概知道是什么意思了,就是元素里面没有任何东西(子元素/内容)的时候就匹配.</p>
<p><strong id="u_c">:has(selector)</strong><br />
用法: <em>$(“div:has(p)”).addClass(“test”) ;</em><br />
说明: 匹配含有选择器所匹配的元素的元素.这个解释需要好好琢磨,但是一旦看了使用的例子就完全清楚了:给所有包含p元素的div标签加上class=”test”.</p>
<p><strong id="u_d">:parent</strong><br />
用法: <em>$(“td:parent”) ;</em><br />
说明: 匹配含有子元素或者文本的元素.注意:这里是”:parent”,可不是”.parent”哦!感觉与上面讲的”:empty”形成反义词.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-contentfilters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 – 基础过滤(Basic Filters)</title>
		<link>http://flex.desizen.com/jquery-selectors-basicfilters/</link>
		<comments>http://flex.desizen.com/jquery-selectors-basicfilters/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 06:08:47 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Basic Filters]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=135</guid>
		<description><![CDATA[本文是jQuery选择器系列之基础过滤(Basic Filters). 基础过滤(Basic Filters)是相对于以后要学习的其他的过滤方法而言的,基础过滤(我小学没毕业,不知道是不是这样翻译)所过滤的内容都是利用jQuery获得到的DOM元素,我的理解就是像一个大筛子,把利用那些基本选择器获得到的集合进行按规则剔除. Basic Filters包括了十部分,稍稍有点多: :first :last :not(selector) :even : odd :eq(index) :gt(index) :lt(index) :header :animated :first 用法: $(“tr:first”) ; 说明: 匹配找到的第一个元素.我以前就遇到了取第一个和最后一个的情况. :last 用法: $(“tr:last”) ; 说明: 匹配找到的最后一个元素.与 :first 相对应. :not(selector) 用法: $(“input:not(:checked)”) ; 说明: 去除所有与给定选择器匹配的元素.有点类似于”非”,意思是没有被选中的input(当input的type=”checkbox”). :even 用法: $(“tr:even”) ; 说明: 匹配所有索引值为偶数的元素，从 0 开始计数.js的数组都是从0开始计数的.例如要选择table中的行,因为是从0开始计数,所以table中的第一个tr就为偶数0. : odd 用法: $(“tr:odd”) ; 说明: 匹配所有索引值为奇数的元素,和:even对应,从 0 开始计数. :eq(index) [...]]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-basicfilters/">基础过滤(Basic Filters)</a>.</p>
<p><strong>基础过滤(Basic Filters)</strong>是相对于以后要学习的其他的过滤方法而言的,基础过滤(我小学没毕业,不知道是不是这样翻译)所过滤的内容都是利用jQuery获得到的DOM元素,我的理解就是像一个大筛子,把利用那些基本选择器获得到的集合进行按规则剔除.<br />
Basic Filters包括了十部分,稍稍有点多:<span id="more-135"></span></p>
<ul>
<li><a href="#u_a">:first</a></li>
<li><a href="#u_b">:last</a></li>
<li><a href="#u_c">:not(selector)</a></li>
<li><a href="#u_d">:even</a></li>
<li><a href="#u_e">: odd</a></li>
<li><a href="#u_f">:eq(index)</a></li>
<li><a href="#u_g">:gt(index)</a></li>
<li><a href="#u_h">:lt(index)</a></li>
<li><a href="#u_i">:header</a></li>
<li><a href="#u_j">:animated</a></li>
</ul>
<p><strong id="u_a">:first</strong><br />
用法: <em>$(“tr:first”) ;</em><br />
说明: 匹配找到的第一个元素.我以前就遇到了取第一个和最后一个的情况.</p>
<p><strong id="u_b">:last</strong><br />
用法: <em>$(“tr:last”) ;</em><br />
说明: 匹配找到的最后一个元素.与 :first 相对应.</p>
<p><strong id="u_c">:not(selector)</strong><br />
用法: <em>$(“input:not(:checked)”) ;</em><br />
说明: 去除所有与给定选择器匹配的元素.有点类似于”非”,意思是没有被选中的input(当input的type=”checkbox”).</p>
<p><strong id="u_d">:even</strong><br />
用法: <em>$(“tr:even”) ;</em><br />
说明: 匹配所有索引值为偶数的元素，从 0 开始计数.js的数组都是从0开始计数的.例如要选择table中的行,因为是从0开始计数,所以table中的第一个tr就为偶数0.</p>
<p><strong id="u_e">: odd</strong><br />
用法: <em>$(“tr:odd”) ;</em><br />
说明: 匹配所有索引值为奇数的元素,和:even对应,从 0 开始计数.</p>
<p><strong id="u_f">:eq(index)</strong><br />
用法: <em>$(“tr:eq(0)”) ;</em><br />
说明: 匹配一个给定索引值的元素.eq(0)就是获取第一个tr元素.括号里面的是索引值,不是元素排列数.</p>
<p><strong id="u_g">:gt(index)</strong><br />
用法: <em>$(“tr:gt(0)”) ;</em><br />
说明: 匹配所有大于给定索引值的元素.</p>
<p><strong id="u_h">:lt(index)</strong><br />
用法: <em>$(“tr:lt(2)”) ;</em><br />
说明: 匹配所有小于给定索引值的元素.</p>
<p><strong id="u_i">:header</strong><br />
用法: <em>$(“:header”).css(“background”, “#EEE”) ;</em><br />
说明: 匹配如 h1, h2, h3之类的标题元素.这个是专门用来获取h1,h2这样的标题元素.</p>
<p><strong id="u_j">:animated</strong><br />
例子:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; 
                    &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&nbsp;
  &lt;script&gt;
  $(document).ready(function(){
&nbsp;
    $(&quot;#run&quot;).click(function(){
      $(&quot;div:animated&quot;).toggleClass(&quot;colored&quot;);
    });
    function animateIt() {
      $(&quot;#mover&quot;).slideToggle(&quot;slow&quot;, animateIt);
    }
    animateIt();
&nbsp;
  });
  &lt;/script&gt;
  &lt;style&gt;
  div { background:yellow; border:1px solid #AAA; width:80px; height:80px; margin:5px; float:left; }
  div.colored { background:green; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;button id=&quot;run&quot;&gt;Run&lt;/button&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div id=&quot;mover&quot;&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>说明: 匹配所有正在执行动画效果的元素.这个需要好好理解下,因为看起来比之前的理解上都难一点.其中,toggleClass是添加/移除class;slideToggle是收缩/伸展块级元素.也就是说slideToggle让其中的一个div在不断的执行动画(收缩/伸展),当点击button时,就用div:animated匹配到了这个元素上,所以改变了颜色.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-basicfilters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 层次(Hierarchy)</title>
		<link>http://flex.desizen.com/jquery-selectors-hierarchy/</link>
		<comments>http://flex.desizen.com/jquery-selectors-hierarchy/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 06:54:23 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Hierarchy]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=112</guid>
		<description><![CDATA[本文是jQuery选择器系列之层次(Hierarchy). 我对层次(Hierarchy)的理解:使用构造的选择符来层层过滤DOM元素. Hierarchy包括了四部分: ancestor descendant parent > child prev + next prev ~ siblings ancestor descendant 用法: $(“form input”) ; 说明: 在给定的祖先元素下匹配所有后代元素.这个要下面讲的”parent > child”区分开. parent > child 用法: $(“form > input”) ; 说明: 在给定的父元素下匹配所有子元素.注意:要区分好后代元素与子元素.这里的是XPath用法,前面前面就说过了,jQuery是可以任意使用XPath选择符的. prev + next 用法: $(“label + input”) ; 说明: 匹配所有紧接在 prev 元素后的 next 元素.需要强调的是:label+其他元素+input这样的是不会被匹配的. prev ~ siblings 用法: $(“form ~ input”) [...]]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-hierarchy/">层次(Hierarchy)</a>.</p>
<p>我对<strong>层次(Hierarchy)</strong>的理解:使用构造的选择符来层层过滤DOM元素.<br />
Hierarchy包括了四部分:<span id="more-112"></span></p>
<ul>
<li><a href="#u_an">ancestor descendant</a></li>
<li><a href="#u_pa">parent > child</a></li>
<li><a href="#u_ne">prev + next</a></li>
<li><a href="#u_si">prev ~ siblings</a></li>
</ul>
<p><strong id="u_an">ancestor descendant</strong><br />
用法: <em>$(“form input”) ;</em><br />
说明: 在给定的祖先元素下匹配<strong>所有后代元素</strong>.这个要下面讲的”parent > child”区分开.</p>
<p><strong id="u_pa">parent > child</strong><br />
用法: <em>$(“form > input”) ;</em><br />
说明: 在给定的父元素下匹配<strong>所有子元素</strong>.注意:要区分好后代元素与子元素.这里的是XPath用法,前面前面就说过了,jQuery是可以任意使用XPath选择符的.</p>
<p><strong id="u_ne">prev + next</strong><br />
用法: <em>$(“label + input”) ;</em><br />
说明: 匹配所有紧接在 prev 元素后的 next 元素.需要强调的是:label+其他元素+input这样的是不会被匹配的.</p>
<p><strong id="u_si">prev ~ siblings</strong><br />
用法: <em>$(“form ~ input”) ;</em><br />
说明: 匹配 prev 元素之后的所有 siblings 元素.注意:是匹配<strong>之后</strong>的元素,<strong>不</strong>包含该元素在内,并且siblings匹配的是和prev同辈的元素,其后辈元素不被匹配.</p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-hierarchy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery选择器 &#8211; 基本(Basics)</title>
		<link>http://flex.desizen.com/jquery-selectors-basics/</link>
		<comments>http://flex.desizen.com/jquery-selectors-basics/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 04:27:59 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://flex.joelove.cn/?p=100</guid>
		<description><![CDATA[本文是jQuery选择器系列之基本(Basics). 在继续学习之前,我们必须具备一些jQuery的基本知识,至少要知道jQuery是使用”$”作为替代符,而且要了解HTML与CSS知识等. 这个Basics在jQuery选择器中是最好掌握,也是使用最多的部分了.因为我们在制作简单的页面效果时是不需要采取多么的复杂的dom选择的. API文档中把它分为了六部分: #id element .class .class.class * selector1, selector2, selectorN #id 用法: $(“#myDiv”); 说明: 这个就是直接选择html中的id=”myDiv”,值得注意的是:如果选择器中包含特殊字符，可以用两个斜杠(\\)转义,至少,”.”, “[", "]” 是特殊字符.选择符内可以把双引号改为单引号,不过在复杂点的获取DOM的时候,单引号总是会引发歧义或错误,还是使用双引号吧. element 用法: $(“div”); 说明: element的英文翻译过来是”元素”,所以element其实就是html已经定义的标签元素,例如 div, input, a 等等. .class 用法: $(“.myClass”); 说明: 这个标签是直接选择html代码中class=”myClass”的元素或元素组(因为在同一html页面中class是可以存在多个同样值的). .class.class 用法: $(“.myClass.myOtherClass”); 说明: 这个用法貌似是新的,意思就是仅匹配html中class=”myClass myOtherClass”的元素,而class=”myClass”和class=”myOtherClass”这样的class是不匹配的. * 用法: $(“*”); 说明: 匹配所有元素,多用于结合上下文来搜索.目前我还没用上它,不过看说明说是用来结合搜索用的,那么肯定会在大规模应用中用到吧. selector1, selector2, selectorN 用法: $(“div,span,p.myClass”) 说明: 将每一个选择器匹配到的元素合并后一起返回.你可以指定任意多个选择器,并将匹配到的元素合并到一个结果内.其中p.myClass是表示匹配元素p class=”myClass”]]></description>
			<content:encoded><![CDATA[<p>本文是<a href="http://flex.joelove.cn/jquery-selectors/">jQuery选择器</a>系列之<a href="http://flex.joelove.cn/jquery-selectors-basics/">基本(Basics)</a>.<br />
在继续学习之前,我们必须具备一些jQuery的基本知识,至少要知道jQuery是使用”$”作为替代符,而且要了解HTML与CSS知识等.</p>
<p>这个Basics在jQuery选择器中是最好掌握,也是使用最多的部分了.因为我们在制作简单的页面效果时是不需要采取多么的复杂的dom选择的.<span id="more-100"></span><br />
<a href="http://docs.jquery.com/Selectors">API文档</a>中把它分为了六部分:</p>
<ul>
<li><a href="#u_id">#id</a></li>
<li><a href="#u_element">element</a></li>
<li><a href="#u_class">.class</a></li>
<li><a href="#u_classclass">.class.class</a></li>
<li><a href="#u_x">*</a></li>
<li><a href="#u_selector">selector1, selector2, selectorN</a></li>
</ul>
<h2 id="u_id">#id</h2>
<p>用法: <em>$(“#myDiv”); </em><br />
说明: 这个就是直接选择html中的<em>id=”myDiv”</em>,值得注意的是:<strong>如果选择器中包含特殊字符，可以用两个斜杠(\\)转义</strong>,至少,”.”, “[", "]” 是特殊字符.选择符内可以把双引号改为单引号,不过在复杂点的获取DOM的时候,单引号总是会引发歧义或错误,还是使用双引号吧.</p>
<h2 id="u_element">element</h2>
<p>用法: <em>$(“div”); </em><br />
说明: element的英文翻译过来是”元素”,所以element其实就是html已经定义的标签元素,例如 div, input, a 等等.</p>
<h2 id="u_class">.class</h2>
<p>用法: <em>$(“.myClass”);</em><br />
说明: 这个标签是直接选择html代码中class=”myClass”的元素或元素组(因为在同一html页面中class是可以存在多个同样值的).</p>
<h2 id="u_classclass">.class.class</h2>
<p>用法: <em>$(“.myClass.myOtherClass”); </em><br />
说明: 这个用法貌似是新的,意思就是仅匹配html中<em>class=”myClass myOtherClass”</em>的元素,而<em>class=”myClass”</em>和<em>class=”myOtherClass”</em>这样的class是不匹配的.</p>
<h2 id="u_x">*</h2>
<p>用法: <em>$(“*”);</em><br />
说明: 匹配所有元素,多用于结合上下文来搜索.目前我还没用上它,不过看说明说是用来结合搜索用的,那么肯定会在大规模应用中用到吧.</p>
<h2 id="u_selector">selector1, selector2, selectorN</h2>
<p>用法: <em>$(“div,span,p.myClass”) </em><br />
说明: 将每一个选择器匹配到的元素合并后一起返回.你可以指定任意多个选择器,并将匹配到的元素合并到一个结果内.其中<em>p.myClass</em>是表示匹配元素<em>p class=”myClass”</em></p>
]]></content:encoded>
			<wfw:commentRss>http://flex.desizen.com/jquery-selectors-basics/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

