<?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>小生同学的碎碎念 &#187; javascript</title>
	<atom:link href="http://www.chenxiaosheng.com/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chenxiaosheng.com</link>
	<description></description>
	<lastBuildDate>Thu, 02 Sep 2010 06:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>說說我今天干的比較BT的一件事(&#8216;搞定&#8217;IE下的select disabled)</title>
		<link>http://www.chenxiaosheng.com/2010/01/18/320.html</link>
		<comments>http://www.chenxiaosheng.com/2010/01/18/320.html#comments</comments>
		<pubDate>Mon, 18 Jan 2010 12:06:46 +0000</pubDate>
		<dc:creator>陈小生</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.chenxiaosheng.com/?p=320</guid>
		<description><![CDATA[先吼一句:瀏覽器標準不統一真不是一件好事吧,拍磚的請砸向遠方,我扛不住.. 好吧,說說我BT的需求先&#60;之前已經被同事小朋友說需求BT了,哈&#62;: 有一個表單,裡面有幾個select選項,我需要顯示給用戶看,可我又不給你選,但我又希望這個表單能以正常的方式提交,select什麼就是什麼,我不想把他搞成TXT或者input readonly的形式給用戶看,我就是要以表單的形式體現..orz,我可真固執.. 好吧,其實原因是這樣的,這個postaction的後面,我是用了一個django的form,我不想搞成txt或者input的形式就是不想在我傳給這個form之前我還要做預處理..是不是很想砸我,好吧,這些都不是重點,看看我是怎麼&#8221;搞定&#8221;的吧,之所以搞定加了雙引號,是因為我沒有本質上的搞定,但達到了我的需求了-_- 假設某個select的ID是id_rdtype,如: &#60;select name=&#8221;rdtype&#8221; id=&#8221;id_rdtype&#8221;&#62; &#60;option value=&#8221;CNAME&#8221;&#62;CNAME&#60;/option&#62; &#60;option value=&#8221;A&#8221; selected=&#8221;selected&#8221;&#62;A&#60;/option&#62; &#60;/select&#62; 默認展現給用戶看的是A,可我又不想給用戶選到CNAME,好吧,第一次我是這樣做的: $(&#8220;#id_rdtype&#8221;).attr({ &#8216;disabled&#8217;:true }) 好吧,選是不能選了,用戶也確實看不到,可是後臺看不到-_-這樣做的後果是這個post動作不傳這個值,那就不是我要的結果了,我還是希望他告訴我,這個值是這樣的,好吧,再無語自己一下,什麼需求嘛,再來看看我的第二個辦法: $(&#8220;#id_rdtype option:not(:selected)&#8221;).attr(&#8220;disabled&#8221;,&#8221;disabled&#8221;) 先偷偷告訴你,如果沒有使用jQuery,這個javascript語句是不幹活地,所以,請記得先加載jQuery的文件,嗯,這次算是好一點,確認可以了,傳值,包括給用戶的體驗都可以做到了&#60;我把所有未被默認選擇到的元素disabled了&#62;,等等,拿多幾個瀏覽器測試下,杯具了,發現ie6/ie7設置這個disabled沒用,orz,我可不能漏著這個大&#8221;BUG&#8221;丫,再想辦法..google之,好吧,確實找到了一些解決辦法,大部份都是借助jQuery的,可好吧,不得不再說一下我自己,我實在不想寫那麼多句javascript-_-真懶&#8230;繼續想辦法 華麗麗滴,讓我想到了一個辦法,下狠手,我一不做,二不休..把其它&#8221;元素&#8221;和諧掉,那不就可以了-_- $(&#8220;#id_rdtype option:not(:selected)&#8221;).remove() 好了,我要的問題終於解決了,我得意的笑啊得意的笑~ 您可能还会对以下文章感兴趣：10个最佳jQuery Lightbox效果插件收集jQuery Tools：我们期待已久的内容展示型 Web UI 库]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p>先吼一句:瀏覽器標準不統一真不是一件好事吧,拍磚的請砸向遠方,我扛不住..</p>
<p>好吧,說說我BT的需求先&lt;之前已經被同事小朋友說需求BT了,哈&gt;:</p>
<blockquote><p>有一個表單,裡面有幾個select選項,我需要顯示給用戶看,可我又不給你選,但我又希望這個表單能以正常的方式提交,select什麼就是什麼,我不想把他搞成TXT或者input readonly的形式給用戶看,我就是要以表單的形式體現..orz,我可真固執..</p></blockquote>
<p>好吧,其實原因是這樣的,這個postaction的後面,我是用了一個django的form,我不想搞成txt或者input的形式就是不想在我傳給這個form之前我還要做預處理..是不是很想砸我,好吧,這些都不是重點,看看我是怎麼&#8221;搞定&#8221;的吧,之所以搞定加了雙引號,是因為我沒有本質上的搞定,但達到了我的需求了-_-</p>
<p>假設某個select的ID是id_rdtype,如:</p>
<blockquote><p>&lt;select name=&#8221;rdtype&#8221; id=&#8221;id_rdtype&#8221;&gt;</p>
<p>&lt;option value=&#8221;CNAME&#8221;&gt;CNAME&lt;/option&gt;<br />
&lt;option value=&#8221;A&#8221; selected=&#8221;selected&#8221;&gt;A&lt;/option&gt;</p>
<p>&lt;/select&gt;</p></blockquote>
<p><span id="more-320"></span></p>
<p>默認展現給用戶看的是A,可我又不想給用戶選到CNAME,好吧,第一次我是這樣做的:</p>
<blockquote><p>$(&#8220;#id_rdtype&#8221;).attr({<br />
&#8216;disabled&#8217;:true<br />
})</p></blockquote>
<p>好吧,選是不能選了,用戶也確實看不到,可是後臺看不到-_-這樣做的後果是這個post動作不傳這個值,那就不是我要的結果了,我還是希望他告訴我,這個值是這樣的,好吧,再無語自己一下,什麼需求嘛,再來看看我的第二個辦法:</p>
<blockquote><p>$(&#8220;#id_rdtype option:not(:selected)&#8221;).attr(&#8220;disabled&#8221;,&#8221;disabled&#8221;)</p></blockquote>
<p>先偷偷告訴你,如果沒有使用jQuery,這個javascript語句是不幹活地,所以,請記得先加載jQuery的文件,嗯,這次算是好一點,確認可以了,傳值,包括給用戶的體驗都可以做到了&lt;我把所有未被默認選擇到的元素disabled了&gt;,等等,拿多幾個瀏覽器測試下,杯具了,發現ie6/ie7設置這個disabled沒用,orz,我可不能漏著這個大&#8221;BUG&#8221;丫,再想辦法..google之,好吧,確實找到了一些解決辦法,大部份都是借助jQuery的,可好吧,不得不再說一下我自己,我實在不想寫那麼多句javascript-_-真懶&#8230;繼續想辦法</p>
<p>華麗麗滴,讓我想到了一個辦法,下狠手,我一不做,二不休..把其它&#8221;元素&#8221;和諧掉,那不就可以了-_-</p>
<blockquote><p>$(&#8220;#id_rdtype option:not(:selected)&#8221;).remove()</p></blockquote>
<p>好了,我要的問題終於解決了,我得意的笑啊得意的笑~</p>
<h3  class="related_post_title">您可能还会对以下文章感兴趣：</h3><ul class="related_post"><li><a href="http://www.chenxiaosheng.com/2009/10/09/222.html" title="10个最佳jQuery Lightbox效果插件收集">10个最佳jQuery Lightbox效果插件收集</a></li><li><a href="http://www.chenxiaosheng.com/2009/10/13/239.html" title="jQuery Tools：我们期待已久的内容展示型 Web UI 库">jQuery Tools：我们期待已久的内容展示型 Web UI 库</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.chenxiaosheng.com/2010/01/18/320.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>10个最佳jQuery Lightbox效果插件收集</title>
		<link>http://www.chenxiaosheng.com/2009/10/09/222.html</link>
		<comments>http://www.chenxiaosheng.com/2009/10/09/222.html#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:57:33 +0000</pubDate>
		<dc:creator>陈小生</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[lightbox]]></category>

		<guid isPermaLink="false">http://www.chenxiaosheng.com/?p=222</guid>
		<description><![CDATA[原文：10个最佳jQuery Lightbox效果插件收集 译自：Rounding Up the Top 10 jQuery Lightbox Scripts 版权所有，转载请注明出处，多谢！ PS:这个效果的插件自己在多个地方用到了，有mootools的，也有jQuery的，收藏一下 大家都很喜欢Lightbox弹框效果，这种效果在很多地方都很有用。而原始的Lightbox脚本已经被无数次的克隆到了所有的流行Javascript库中。本文特别收集了10个最佳的Lightbox效果插件，所以收藏本文吧，不定什么时候你就用到了…… jQuery Lightbox Plugin 支持的媒体类型： Images 演示 下载 Fancybox 支持的媒体类型： Images, Inline HTML, iFrame 演示 下载 Shadowbox 支持的媒体类型： Images, Inline HTML, iFrame, AJAX, Flash, Video 演示 下载 ThickBox 支持的媒体类型： Images, Inline HTML, iFrame, AJAX 演示 下载 Slightly Thickerbox 支持的媒体类型： Images, AJAX, Video 演示 [...]]]></description>
			<content:encoded><![CDATA[<div>原文：<a href="http://www.qianduan.net/top-10-jquery-lightbox-scripts.html">10个最佳jQuery Lightbox效果插件收集</a><br />
译自：<a href="http://line25.com/articles/rounding-up-the-top-10-jquery-lightbox-scripts">Rounding Up the Top 10 jQuery Lightbox Scripts</a><br />
版权所有，转载请注明出处，多谢！</div>
<div><strong><br />
PS:这个效果的插件自己在多个地方用到了，有mootools的，也有jQuery的，收藏一下 </strong></p>
<hr /></div>
<p>大家都很喜欢Lightbox弹框效果，这种效果在很多地方都很有用。而原始的Lightbox脚本已经被无数次的克隆到了所有的流行Javascript库中。本文特别收集了10个最佳的Lightbox效果插件，所以收藏本文吧，不定什么时候你就用到了……<span id="more-222"></span></p>
<p><span id="more-10970"> </span></p>
<h3><a href="http://leandrovieira.com/projects/jquery/lightbox/">jQuery Lightbox Plugin</a></h3>
<p><a href="http://leandrovieira.com/projects/jquery/lightbox/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/lightbox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images</p>
<p><a href="http://leandrovieira.com/projects/jquery/lightbox/">演示</a></p>
<p><a href="http://leandrovieira.com/projects/jquery/lightbox/">下载</a></p>
<h3><a href="http://fancy.klade.lv/">Fancybox</a></h3>
<p><a href="http://fancy.klade.lv/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/fancybox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, iFrame</p>
<p><a href="http://fancy.klade.lv/example">演示</a></p>
<p><a href="http://fancy.klade.lv/">下载</a></p>
<h3><a href="http://www.shadowbox-js.com/index.html">Shadowbox</a></h3>
<p><a href="http://www.shadowbox-js.com/index.html"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/shadowbox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, iFrame, AJAX, Flash, Video</p>
<p><a href="http://www.shadowbox-js.com/index.html">演示</a></p>
<p><a href="http://www.shadowbox-js.com/index.html">下载</a></p>
<h3><a href="http://jquery.com/demo/thickbox/">ThickBox</a></h3>
<p><a href="http://jquery.com/demo/thickbox/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/thickbox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, iFrame, AJAX</p>
<p><a href="http://jquery.com/demo/thickbox/">演示</a></p>
<p><a href="http://jquery.com/demo/thickbox/">下载</a></p>
<h3><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/">Slightly Thickerbox</a></h3>
<p><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/slightly.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, AJAX, Video</p>
<p><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/">演示</a></p>
<p><a href="http://www.jasons-toolbox.com/SlightlyThickerbox/">下载</a></p>
<h3><a href="http://orderedlist.com/articles/fancyzoom-meet-jquery">Fancy Zoom</a></h3>
<p><a href="http://orderedlist.com/articles/fancyzoom-meet-jquery"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/fancyzoom.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, Flash</p>
<p><a href="http://orderedlist.com/demos/fancy-zoom-jquery/">演示</a></p>
<p><a href="http://orderedlist.com/articles/fancyzoom-meet-jquery">下载</a></p>
<h3><a href="http://famspam.com/facebox">Facebox</a></h3>
<p><a href="http://famspam.com/facebox"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/facebox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, AJAX</p>
<p><a href="http://famspam.com/facebox">演示</a></p>
<p><a href="http://famspam.com/facebox">下载</a></p>
<h3><a href="http://nyromodal.nyrodev.com/">nyroModal</a></h3>
<p><a href="http://nyromodal.nyrodev.com/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/nyromodal.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, Inline HTML, iFrame, AJAX, Video</p>
<p><a href="http://nyromodal.nyrodev.com/">演示</a></p>
<p><a href="http://nyromodal.nyrodev.com/">下载</a></p>
<h3><a href="http://www.intelliance.fr/jquery/imagebox/">Interface Imagebox Demo</a></h3>
<p><a href="http://www.intelliance.fr/jquery/imagebox/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/imagebox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images</p>
<p><a href="http://www.intelliance.fr/jquery/imagebox/">演示</a></p>
<p><a href="http://www.intelliance.fr/jquery/imagebox/">下载</a></p>
<h3><a href="http://www.pirolab.it/pirobox/">piroBox</a></h3>
<p><a href="http://www.pirolab.it/pirobox/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/piro.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images</p>
<p><a href="http://www.pirolab.it/pirobox/">演示</a></p>
<p><a href="http://www.pirolab.it/pirobox/">下载</a></p>
<h3><a href="http://jquery.com/demo/grey/">Greybox Redux</a></h3>
<p><a href="http://jquery.com/demo/grey/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/greybox.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images, iFrame</p>
<p><a href="http://jquery.com/demo/grey/">演示</a></p>
<p><a href="http://jquery.com/demo/grey/">下载</a></p>
<h3><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">prettyPhoto</a></h3>
<p><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/"><img src="http://www.qianduan.net/wp-content/uploads/2009/07/lightbox/piro.jpg" alt="Download Lightbox script" /></a></p>
<p><strong>支持的媒体类型：</strong> Images</p>
<p><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">演示</a></p>
<p><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">下载</a></p>
<h3  class="related_post_title">您可能还会对以下文章感兴趣：</h3><ul class="related_post"><li><a href="http://www.chenxiaosheng.com/2010/01/18/320.html" title="說說我今天干的比較BT的一件事(&#8216;搞定&#8217;IE下的select disabled)">說說我今天干的比較BT的一件事(&#8216;搞定&#8217;IE下的select disabled)</a></li><li><a href="http://www.chenxiaosheng.com/2009/10/13/239.html" title="jQuery Tools：我们期待已久的内容展示型 Web UI 库">jQuery Tools：我们期待已久的内容展示型 Web UI 库</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.chenxiaosheng.com/2009/10/09/222.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
