<?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>S i X h E a D { ? } &#187; jquery</title>
	<atom:link href="http://sixhead.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixhead.com</link>
	<description>เมื่อความรู้มีไว้แบ่งปัน</description>
	<lastBuildDate>Mon, 27 Feb 2012 06:23:10 +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>จำกัดจำนวนตัวอักษรใน textarea</title>
		<link>http://sixhead.com/2009/06/30/limit-textarea-maxlength/</link>
		<comments>http://sixhead.com/2009/06/30/limit-textarea-maxlength/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:01:01 +0000</pubDate>
		<dc:creator>Pipo</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[length]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://sixhead.com/?p=455</guid>
		<description><![CDATA[บางครั้งเราต้องการจำกัดจำนวนตัวอักษรใน textarea ปรากฏว่ามันไม่ง่ายเหมือน text box ที่เราสามารถใส่ attribute maxlength เข้าไปจำกัดตัวอักษรได้ตรงๆ จึงต้องใช้ jquery เข้ามาช่วยดังตัวอย่าง &#160; &#60;script src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js&#34;&#62;&#60;/script&#62; &#60;script&#62; $(document).ready(function(){ $('#Wish').keyup(function(){ var max = parseInt($(this).attr('maxlength')); if($(this).val().length &#62; max){ $(this).val($(this).val().substr(0, $(this).attr('maxlength'))); } $('#WishMax').html('เหลืออีก ' + (max - $(this).val().length) + ' ตัวอักษร'); }); }); &#60;/script&#62; &#160; &#60;textarea name=&#34;Wish&#34; id=&#34;Wish&#34; maxlength=&#34;10&#34;&#62;&#60;/textarea&#62; &#60;div id=&#34;WishMax&#34;&#62;&#60;/div&#62; &#160;]]></description>
			<content:encoded><![CDATA[<p>บางครั้งเราต้องการจำกัดจำนวนตัวอักษรใน textarea ปรากฏว่ามันไม่ง่ายเหมือน text box ที่เราสามารถใส่ attribute maxlength เข้าไปจำกัดตัวอักษรได้ตรงๆ จึงต้องใช้ jquery เข้ามาช่วยดังตัวอย่าง<br />
<span id="more-455"></span></p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script&gt;</span></a></span>
$(document).ready(function(){
	$('#Wish').keyup(function(){
		var max = parseInt($(this).attr('maxlength'));
		if($(this).val().length &gt; max){
			$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
		}
		$('#WishMax').html('เหลืออีก ' + (max - $(this).val().length) + ' ตัวอักษร');
	});
});
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">&lt;textarea</span></a> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Wish&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;Wish&quot;</span> <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/textarea&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;WishMax&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
&nbsp;</pre>
<p><map name='google_ad_map_455_f21c57aff87a446f'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/455?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_455_f21c57aff87a446f' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=455&amp;url= http%3A%2F%2Fsixhead.com%2F2009%2F06%2F30%2Flimit-textarea-maxlength%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://sixhead.com/2009/06/30/limit-textarea-maxlength/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>เริ่มต้นง่ายๆกับ jQuery</title>
		<link>http://sixhead.com/2008/01/31/simple-start-with-jquery/</link>
		<comments>http://sixhead.com/2008/01/31/simple-start-with-jquery/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 16:50:14 +0000</pubDate>
		<dc:creator>Pipo</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://sixhead.com/2008/01/31/simple-start-with-jquery/</guid>
		<description><![CDATA[ไม่ต้องพูดอะไรกันมาก เริ่มเรียนรู้กันจากตัวอย่างไปเลย ใช้งานง่ายมากๆ เขียน code บรรทัดเดียว ก็จะได้ คำสั่ง show, hide, หรือ fade effect แบบสวยงามได้แล้ว ดูตัวอย่างที่นี่ #testDiv &#123; background-color:#3399CC; font: 12px Tahoma, Arial, sans-serif; color:#FFFFFF; width: 150px; height: 100px; text-align:center; &#125; .testClass &#123; background-color:#FF0000; font: 12px Tahoma, Arial, sans-serif; color:#FFFFFF; width: 150px; height: 100px; text-align:center; &#125; * #testDiv และ .testClass ใน css เอาไว้แค่กำหนดหน้าตาเฉยๆ ไม่มีผลกับ jquery &#60;script [...]]]></description>
			<content:encoded><![CDATA[<p>ไม่ต้องพูดอะไรกันมาก เริ่มเรียนรู้กันจากตัวอย่างไปเลย ใช้งานง่ายมากๆ เขียน code บรรทัดเดียว<br />
ก็จะได้ คำสั่ง show, hide, หรือ fade effect แบบสวยงามได้แล้ว<br />
<span id="more-14"></span></p>
<p><a href="http://sixhead.com/testrun/jquery/2008.01.31/demo.html" target="_blank">ดูตัวอย่างที่นี่</a></p>
<pre class="css"><span style="color: #cc00cc;">#testDiv</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#3399CC</span>;
	<span style="color: #000000; font-weight: bold;">font</span>: <span style="color: #933;">12px</span> Tahoma, Arial, <span style="color: #993333;">sans-serif</span>;
	<span style="color: #000000; font-weight: bold;">color</span>:<span style="color: #cc00cc;">#FFFFFF</span>;
	<span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;">150px</span>;
	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">100px</span>;
	text-align<span style="color: #3333ff;">:center</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #6666ff;">.testClass</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#FF0000</span>;
	<span style="color: #000000; font-weight: bold;">font</span>: <span style="color: #933;">12px</span> Tahoma, Arial, <span style="color: #993333;">sans-serif</span>;
	<span style="color: #000000; font-weight: bold;">color</span>:<span style="color: #cc00cc;">#FFFFFF</span>;
	<span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;">150px</span>;
	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">100px</span>;
	text-align<span style="color: #3333ff;">:center</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>* #testDiv และ .testClass ใน css เอาไว้แค่กำหนดหน้าตาเฉยๆ ไม่มีผลกับ jquery</p>
<pre class="html4strict"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;jquery.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--mce:0--&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></pre>
<p>บรรทัด 26. เป็นการเรียกโหลด jquery.js เข้ามา</p>
<pre class="javascript">&lt;a onclick=<span style="color: #3366CC;">&quot;$('#testDiv').show();&quot;</span> href=<span style="color: #3366CC;">&quot;javascript:void(0);&quot;</span>&gt;Show&lt;/a&gt;
&lt;a onclick=<span style="color: #3366CC;">&quot;$('#testDiv').hide();&quot;</span> href=<span style="color: #3366CC;">&quot;javascript:void(0);&quot;</span>&gt;Hide&lt;/a&gt;</pre>
<p>บรรทัด 31. จุดสำคัญมันอยู่ตรงนี้ onclick="<strong>$('#testDiv').show();</strong>" คำสั่งนี้คือการ เลือกที่จะทำงานกับ<br />
div (ขึ้นต้นด้วย #) ที่ชื่อว่า #testDiv นั่นเอง</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;testDiv&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>ข้อความ .. .. .. ข้อความ<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
&nbsp;</pre>
<pre class="javascript">&lt;a onclick=<span style="color: #3366CC;">&quot;$('.testClass').show();&quot;</span> href=<span style="color: #3366CC;">&quot;javascript:void(0);&quot;</span>&gt;Show&lt;/a&gt;
&lt;a onclick=<span style="color: #3366CC;">&quot;$('.testClass').hide();&quot;</span> href=<span style="color: #3366CC;">&quot;javascript:void(0);&quot;</span>&gt;Hide&lt;/a&gt;</pre>
<p>บรรทัด 49. ในทำนองเดียวกัน onclick="<strong>$('.testClass').show();</strong>" คำสั่งนี้คือการ เลือกที่จะทำงานกับ<br />
class (ขึ้นต้นด้วย .) ที่ชื่อว่า .testClass นั่นเอง</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;testClass&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>ข้อความ .. .. .. ข้อความ<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
&nbsp;</pre>
<p>ส่วนคำสั่ง fadeIn, fadeOut ก็ดูได้จาก source code ในตัวอย่างได้เลย<br />
เห็นไหมครับว่ามันง่ายขนาดไหน ต่อให้เป็น web designer ก็ตามยังสามารถที่จะลองทำได้ง่ายๆ เลย</p>
<p>อันที่จริงแล้ว jQuery นั้นมีคำสั่งที่สั้นกว่านี้อีกไว้จะเขียนเพิ่มในตอนต่อๆ ไป</p>
<p><map name='google_ad_map_14_f21c57aff87a446f'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/14?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_14_f21c57aff87a446f' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=14&amp;url= http%3A%2F%2Fsixhead.com%2F2008%2F01%2F31%2Fsimple-start-with-jquery%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://sixhead.com/2008/01/31/simple-start-with-jquery/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>jQuery: The Write Less, Do More, JavaScript Library</title>
		<link>http://sixhead.com/2008/01/25/jquery-the-write-less-do-more-javascript-library/</link>
		<comments>http://sixhead.com/2008/01/25/jquery-the-write-less-do-more-javascript-library/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 17:43:32 +0000</pubDate>
		<dc:creator>Pipo</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.sixhead.com/2008/01/25/jquery-the-write-less-do-more-javascript-library/</guid>
		<description><![CDATA[ถึงเวลานี้ jquery โดนใจอย่างจัง http://jquery.com/ ยุคแรกๆ ที่ผมเริ่มทำพวก show ๆ hideๆ div, css, ajax ฯลฯ จะทำอะไรกันแต่ละที ต้องมานั่งเขียน function JavaScript เองใช้เวลาไปเยอะมาก แถมออกมาก็พอไป วัดไปวาได้ แต่ถ้าจะเอามาใช้ใหม่ทีก็ลำบากหน่อย ช่วงหลังงาน web developer ที่ทำอยู่ มีความต้องการที่จะใส่ลูกเล่น และความสวยงาม ให้มากยิ่งขึ้น ผมจึงไม่รอช้าหา Library ที่จะทำงานพวกนี้ให้ง่ายขึ้น ก็หาใน google.com หาไปเรื่อยๆ ลองไปเรื่อย สุดท้ายมาเจอ jquery ดูการทำงานและ plugin แล้วเป็นที่หน้า พอใจจึงได้เริ่มลองใช้งาน ปรากฏว่าหลงรัก jquery เข้าอย่างจัง ในเรื่องต่อๆ ไปจะเอา พวก function และ plugin ดีๆ มา review ให้ดูกันครับ]]></description>
			<content:encoded><![CDATA[<p>ถึงเวลานี้ jquery โดนใจอย่างจัง <a href="http://jquery.com/" title="jquery">http://jquery.com/</a></p>
<p>ยุคแรกๆ ที่ผมเริ่มทำพวก show ๆ hideๆ div, css, ajax ฯลฯ จะทำอะไรกันแต่ละที<br />
ต้องมานั่งเขียน function JavaScript เองใช้เวลาไปเยอะมาก แถมออกมาก็พอไป<br />
วัดไปวาได้ แต่ถ้าจะเอามาใช้ใหม่ทีก็ลำบากหน่อย</p>
<p>ช่วงหลังงาน web developer ที่ทำอยู่ มีความต้องการที่จะใส่ลูกเล่น และความสวยงาม<br />
ให้มากยิ่งขึ้น ผมจึงไม่รอช้าหา Library ที่จะทำงานพวกนี้ให้ง่ายขึ้น ก็หาใน google.com<br />
หาไปเรื่อยๆ ลองไปเรื่อย สุดท้ายมาเจอ jquery  ดูการทำงานและ plugin แล้วเป็นที่หน้า<br />
พอใจจึงได้เริ่มลองใช้งาน ปรากฏว่าหลงรัก jquery เข้าอย่างจัง ในเรื่องต่อๆ ไปจะเอา<br />
พวก function และ plugin ดีๆ มา review ให้ดูกันครับ</p>
<p><map name='google_ad_map_7_f21c57aff87a446f'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/7?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_7_f21c57aff87a446f' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=7&amp;url= http%3A%2F%2Fsixhead.com%2F2008%2F01%2F25%2Fjquery-the-write-less-do-more-javascript-library%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://sixhead.com/2008/01/25/jquery-the-write-less-do-more-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

