<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>บทความ PHP AJAX CSS Javascript MySql jQuery</title><link>http://www.ninenik.com</link><description>รวมบทความ PHP Ajax css javascript jQuery เว็บไซต์สำเร็จรูป CMSPro</description><language>th-TH</language><lastBuildDate>Fri, 12 Mar 2010 10:47:55 +0700</lastBuildDate><copyright>Copyright ninenik.com</copyright><image><title>CMSPro เว็บไซต์สำเร็จรูป</title><url>http://www.ninenik.com/images/logo_ninenik.gif</url><link>http://www.ninenik.com</link></image><item><title>ประยุกต์ แปลเนื้อหา ในเว็บไซต์ด้วย google translater api สำหรับ php</title><link>http://www.ninenik.com/ประยุกต์_แปลเนื้อหา_ในเว็บไซต์ด้วย_google_translater_api_สำหรับ_php-261.html</link><description><![CDATA[<p>&nbsp;ดาวน์โหลด</p>
<div><a href="http://www.ninenik.com/download/gTranslate.rar">http://www.ninenik.com/download/gTranslate.rar</a></div>
<div>&nbsp;</div>
<div>
<div><strong>ประกอบด้วยไฟล์</strong></div>
<div>1.example.php ไฟล์ตัวอย่างรวม</div>
<div>2.example_curl.php ไฟล์การใช้งานผ่านฟังก์ชัน curl</div>
<div>3.Gtranslate.php ไฟล์ class สำหรับเรียกใช้งาน</div>
<div>4.languages.ini ไฟล์ภาษาสำหรับการสนับสนุนหลายภาษา</div>
<div>&nbsp;</div>
<div>การแปลงภาษาไทยเป็นอังกฤษใช้ th_to_en</div>
<div>และภาษาอังกฤษเป็นไทยใช้ en_to_th</div>
<div>กรณ๊อื่นๆ ใช้ตัวย่อตามภาษาที่ต้องการ</div>
<div>&nbsp;</div>
<div><strong>สร้างฟังก์ชัน สำหรับนำไปประยุกต์ใช้</strong></div>
<div>&nbsp;</div>
<pre name="code" class="php:controls">
&lt;?php
require(&quot;GTranslate.php&quot;);
function translateEn($str){
 try{
    $gt = new Gtranslate;
	$gt-&gt;setRequestType('curl');
	echo $gt-&gt;th_to_en($str); // ไทยเป็นอังกฤษ หากอังกฤษเป็นไทยกำหนดเป็น en_to_th

} catch (GTranslateException $ge)
 {
    echo $ge-&gt;getMessage();
 }
}
?&gt;</pre>
<div><strong>ตัวอย่างการเรียกใช้งาน</strong></div>
<div>&nbsp;</div>
<pre name="code" class="php:controls">
&lt;?php
$str=&quot;ข้อนี้เป็นภาษาไทย&quot;;
echo translateEn($str);

// หรือ
echo translateEn(&quot;ทดสอบข้อความเป็นภาษาไทย&quot;);

?&gt;</pre>
<div>&nbsp;</div>
</div>
<p>&nbsp;</p>]]></description><pubDate>Tue, 02 Mar 2010 16:34:53 +0700</pubDate></item><item><title>เทคนิค สร้าง effect  add to cart ด้วย jQuery อย่างง่าย</title><link>http://www.ninenik.com/เทคนิค_สร้าง_effect__add_to_cart_ด้วย_jQuery_อย่างง่าย-260.html</link><description><![CDATA[<p>&nbsp;ตัวอย่างต่อไปนี้เป็นแนวทางสำหรับนำไปปรับใช้ ในการทำระบบ add to cart ด้วย ajax</p>
<p><strong>ตัวอย่าง</strong></p>
<p>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td align="left" valign="top">
            <div class="wapProductBox">
            <table width="150" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td height="50" align="center" bgcolor="#CCCC66">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center"><input type="button" name="button" id="button" class="toCart" value="Add to Cart" /></td>
                    </tr>
                </tbody>
            </table>
            </div>
            <div class="wapProductBox">
            <table width="150" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td height="50" align="center" bgcolor="#FF9999">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center"><input type="button" name="button" id="button" class="toCart" value="Add to Cart" /></td>
                    </tr>
                </tbody>
            </table>
            </div>
            <div class="wapProductBox">
            <table width="150" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td height="50" align="center" bgcolor="#00CCFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center"><input type="button" name="button" id="button" class="toCart" value="Add to Cart" /></td>
                    </tr>
                </tbody>
            </table>
            </div>
            <div class="wapProductBox">
            <table width="150" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td height="50" align="center" bgcolor="#FFCC66">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center"><input type="button" name="button" id="button" class="toCart" value="Add to Cart" /></td>
                    </tr>
                </tbody>
            </table>
            </div>
            </td>
            <td width="200" align="left" valign="top" bgcolor="#F2F2F2">
            <div id="boxOfProduct">&nbsp;</div>
            </td>
        </tr>
    </tbody>
</table>
<script type="text/javascript">
$(function(){
	$("input.toCart").click(function(){boxOfProduct
		var nowOffsetX=$(this).parents("div.wapProductBox").offset().left; // หาตำแหน่งสินค้า แกน x
		var nowOffsetY=$(this).parents("div.wapProductBox").offset().top; // หาตำแหน่งสินค้า แกน y
		var moveOffsetX=$("div#boxOfProduct").offset().left; // หาตำแหน่งตะกร้าสินค้า แกน x
		var moveOffsetY=$("div#boxOfProduct").offset().top; // หาตำแหน่งตะกร้าสินค้า แกน y
		var nowObjPhoduct=$(this).parents("div.wapProductBox").clone(); // สร้าง object สินค้าใหม่ โดย copy จากตัวเดิม
		// จัดตำแปน่งไว้ที่เดิม แต่ซ้อนอยู่ด้านบน
		nowObjPhoduct.css({
			position:"absolute",
			left:nowOffsetX+"px",
			top:nowOffsetY+"px",
			"z-index":"900"
		});
		$(document.body).prepend(nowObjPhoduct); // แทรกลงไปในเว็บ
		// ย้ายตำแหน่ง ไปยังตะกร้าสินค้า
		nowObjPhoduct.animate({
			left:moveOffsetX+"px",
			top:moveOffsetY+"px",
			opacity:0
		},500,function(){
			// ฟังก์ชันเมื่อย้ายตำแหน่ง เสร็จต้องการให้ทำอะไร
			// สามารถนำไปประยุกต์ เพิ่มสินค้าในตะกร้าสินค้า ด้วย ajax
			$("div#boxOfProduct").prepend(nowObjPhoduct.html());
		});		
		return false;
	});

});

</script></p>
<p><strong>HTML Code</strong></p>
<p>&nbsp;</p>
<pre name="code" class="xhtml:controls">
&lt;table width=&quot;700&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
  &lt;tr&gt;
    &lt;td align=&quot;left&quot; valign=&quot;top&quot;&gt;
    
&lt;div class=&quot;wapProductBox&quot;&gt;    &lt;table width=&quot;150&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
      &lt;tr&gt;
        &lt;td height=&quot;50&quot; align=&quot;center&quot; bgcolor=&quot;#CCCC66&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;button&quot; name=&quot;button&quot; id=&quot;button&quot;  class=&quot;toCart&quot;value=&quot;Add to Cart&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/div&gt;
    
&lt;div class=&quot;wapProductBox&quot;&gt;    &lt;table width=&quot;150&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
      &lt;tr&gt;
        &lt;td height=&quot;50&quot; align=&quot;center&quot; bgcolor=&quot;#FF9999&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;button&quot; name=&quot;button&quot; id=&quot;button&quot;  class=&quot;toCart&quot;value=&quot;Add to Cart&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/div&gt;
    
&lt;div class=&quot;wapProductBox&quot;&gt;    &lt;table width=&quot;150&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
      &lt;tr&gt;
        &lt;td height=&quot;50&quot; align=&quot;center&quot; bgcolor=&quot;#00CCFF&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;button&quot; name=&quot;button&quot; id=&quot;button&quot;  class=&quot;toCart&quot;value=&quot;Add to Cart&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/div&gt;
    
&lt;div class=&quot;wapProductBox&quot;&gt;    &lt;table width=&quot;150&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
      &lt;tr&gt;
        &lt;td height=&quot;50&quot; align=&quot;center&quot; bgcolor=&quot;#FFCC66&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;button&quot; name=&quot;button&quot; id=&quot;button&quot;  class=&quot;toCart&quot;value=&quot;Add to Cart&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/div&gt;            
    
    &lt;/td&gt;
    &lt;td width=&quot;200&quot; align=&quot;left&quot; valign=&quot;top&quot; bgcolor=&quot;#F2F2F2&quot;&gt;
    &lt;div id=&quot;boxOfProduct&quot;&gt;
    
    &lt;/div&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;</pre>
<p><strong>jQuery Code</strong></p>
<p>&nbsp;</p>
<pre name="code" class="javascript:controls">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	$(&quot;input.toCart&quot;).click(function(){boxOfProduct
		var nowOffsetX=$(this).parents(&quot;div.wapProductBox&quot;).offset().left; // หาตำแหน่งสินค้า แกน x
		var nowOffsetY=$(this).parents(&quot;div.wapProductBox&quot;).offset().top; // หาตำแหน่งสินค้า แกน y
		var moveOffsetX=$(&quot;div#boxOfProduct&quot;).offset().left; // หาตำแหน่งตะกร้าสินค้า แกน x
		var moveOffsetY=$(&quot;div#boxOfProduct&quot;).offset().top; // หาตำแหน่งตะกร้าสินค้า แกน y
		var nowObjPhoduct=$(this).parents(&quot;div.wapProductBox&quot;).clone(); // สร้าง object สินค้าใหม่ โดย copy จากตัวเดิม
		// จัดตำแปน่งไว้ที่เดิม แต่ซ้อนอยู่ด้านบน
		nowObjPhoduct.css({
			position:&quot;absolute&quot;,
			left:nowOffsetX+&quot;px&quot;,
			top:nowOffsetY+&quot;px&quot;,
			&quot;z-index&quot;:&quot;900&quot;
		});
		$(document.body).prepend(nowObjPhoduct); // แทรกลงไปในเว็บ
		// ย้ายตำแหน่ง ไปยังตะกร้าสินค้า
		nowObjPhoduct.animate({
			left:moveOffsetX+&quot;px&quot;,
			top:moveOffsetY+&quot;px&quot;,
			opacity:0
		},500,function(){
			// ฟังก์ชันเมื่อย้ายตำแหน่ง เสร็จต้องการให้ทำอะไร
			// สามารถนำไปประยุกต์ เพิ่มสินค้าในตะกร้าสินค้า ด้วย ajax
			$(&quot;div#boxOfProduct&quot;).prepend(nowObjPhoduct.html());
		});		
		return false;
	});

});

&lt;/script&gt;</pre>
<p>&nbsp;</p>]]></description><pubDate>Wed, 24 Feb 2010 10:30:51 +0700</pubDate></item><item><title>สร้าง Horizontal Accordion แนวนอน ด้วย jQuery อย่างง่าย</title><link>http://www.ninenik.com/สร้าง_Horizontal_Accordion_แนวนอน_ด้วย_jQuery_อย่างง่าย-259.html</link><description><![CDATA[<p><strong>ตัวอย่าง</strong></p>
<p>
<style type="text/css">
div#containSlidebanner{
	margin:0;
	padding:0;
	width:500px;
	height:250px;
	overflow:hidden;
	background-color:#FFFF33;
}
ul#slideBanner,ul#slideBanner li{
	margin:0;
	padding:0;
	list-style:none;
	float:left;
}
ul#slideBanner{
	width:550px;
	white-space:nowrap;
}
ul#slideBanner li{
	width:100px;
	height:250px;
}
li#banner1{
	background-color:#CC99CC;
}
li#banner2{
	background-color:#99CC66;
}
li#banner3{
	background-color:#33CC99;
}
li#banner4{
	background-color:#FFFF66;
}
li#banner5{
	background-color:#CCFF00;
}
</style>

<div id="containSlidebanner">
<ul id="slideBanner">
<li id="banner1"></li>
<li id="banner2"></li>
<li id="banner3"></li>
<li id="banner4"></li>
<li id="banner5"></li>
</ul>
</div>

<script type="text/javascript">
$(function(){
	$("ul#slideBanner li").hover(function(index){
		$(this).animate({
			width:"300px"
		},200);
		$(this).prevAll("li").animate({
			width:"50px"
		},200);
		$(this).nextAll("li").animate({
			width:"50px"
		},200);
	},function(){
		$(this).stop(true);
		$(this).siblings("li").stop(true);
	});
	$("div#containSlidebanner").hover(function(){
	},function(){
		$("ul#slideBanner li").animate({
			width:"100px"
		},200);
	});
});
</script>
</p>
<p><strong>CSS ตัวอย่าง</strong></p>
<pre name="code" class="css:controls">
&lt;style type=&quot;text/css&quot;&gt;
div#containSlidebanner{
	margin:0;
	padding:0;
	width:500px;
	height:250px;
	overflow:hidden;
	background-color:#FFFF33;
}
ul#slideBanner,ul#slideBanner li{
	margin:0;
	padding:0;
	list-style:none;
	float:left;
}
ul#slideBanner{
	width:550px;
	white-space:nowrap;
}
ul#slideBanner li{
	width:100px;
	height:250px;
}
li#banner1{
	background-color:#CC99CC;
}
li#banner2{
	background-color:#99CC66;
}
li#banner3{
	background-color:#33CC99;
}
li#banner4{
	background-color:#FFFF66;
}
li#banner5{
	background-color:#CCFF00;
}
&lt;/style&gt;</pre>
<p><strong>HTML Code ตัวอย่าง</strong></p>
<pre name="code" class="xhtml:controls">
&lt;div id=&quot;containSlidebanner&quot;&gt;
&lt;ul id=&quot;slideBanner&quot;&gt;
&lt;li id=&quot;banner1&quot;&gt;&lt;/li&gt;
&lt;li id=&quot;banner2&quot;&gt;&lt;/li&gt;
&lt;li id=&quot;banner3&quot;&gt;&lt;/li&gt;
&lt;li id=&quot;banner4&quot;&gt;&lt;/li&gt;
&lt;li id=&quot;banner5&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</pre>
<p><strong>jQuery Code ตัวอย่าง</strong></p>
<pre name="code" class="javascript:controls">
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	$(&quot;ul#slideBanner li&quot;).hover(function(index){
		$(this).animate({
			width:&quot;300px&quot;
		},200);
		$(this).prevAll(&quot;li&quot;).animate({
			width:&quot;50px&quot;
		},200);
		$(this).nextAll(&quot;li&quot;).animate({
			width:&quot;50px&quot;
		},200);
	},function(){
		$(this).stop(true);
		$(this).siblings(&quot;li&quot;).stop(true);
	});
	$(&quot;div#containSlidebanner&quot;).hover(function(){
	},function(){
		$(&quot;ul#slideBanner li&quot;).animate({
			width:&quot;100px&quot;
		},200);
	});
});
&lt;/script&gt;</pre>
<p>&nbsp;</p>]]></description><pubDate>Fri, 19 Feb 2010 09:34:01 +0700</pubDate></item><item><title>ประยุกต์ สร้าง  FTP Function สำหรับการจัดการไฟล์ผ่าน FTP Protocal</title><link>http://www.ninenik.com/ประยุกต์_สร้าง__FTP_Function_สำหรับการจัดการไฟล์ผ่าน_FTP_Protocal-258.html</link><description><![CDATA[<p>สร้างไฟล์ php สำหรับ ftp function บันทึกเป็น config_ftp.php ไว้เรียกใช้<p>
<pre name="code" class="php:controls">
&lt;?php      
// ฟังก์ชันการติดกับ server ผ่าน FTP      
function ftpOpen(){      
    // กำหนดค่าการติดต่อ FTP       
    $ftp_user_name = 'username'; // userane      
    $ftp_user_pass = 'password'; // password      
    $ftp_server = 'www.yourdomain.com'; // server      
    $conn_id = ftp_connect($ftp_server);      
    $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);      
    return $conn_id;      
}        
      
// ฟังก์ชันสำหรับกำหนด permissions         
function ftpChmod($conn_id, $permissions,$parentDir,$nameDir){           
    $fullPath=$parentDir.$nameDir;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    ftp_chdir($conn_id,$parentDir); // ไปที่โฟลเดอร์หลักที่จะใช้งาน   
    if($isDir){   
        if(ftp_site($conn_id, 'CHMOD '.$permissions.' '.$fullPath) !== false){         
            return true;         
        }else{      
            return false;         
        }          
    }           
}     
  
// ฟังก์ชันสำหรับสร้าง Directory หรือ Folder   
function ftpMakeDir($conn_id,$parentDir,$nameDir){          
    $fullPath=$parentDir.$nameDir;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    ftp_chdir($conn_id,$parentDir); // ไปที่โฟลเดอร์หลักที่จะใช้งาน   
    if(!$isDir){   
        if(ftp_mkdir($conn_id,$nameDir)) {    
            return true;   
        }else{   
            return false;    
        }          
    }      
}   
  
// ฟังก์ชันสำหรับลบ Directory หรือ Folder (ข้อระวัง* หากมีไฟล์ภายใน ระบบจะลบไฟล์ทั้งหมดใน Folder)   
function ftpRemoveDir($conn_id,$parentDir,$nameDir){         
    $fullPath=$parentDir.$nameDir;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    ftp_chdir($conn_id,$parentDir); // ไปที่โฟลเดอร์หลักที่จะใช้งาน   
    if($isDir){   
		$contents = ftp_nlist($conn_id,$fullPath); 
		if(count($contents)&gt;=3){
			ftp_chdir($conn_id,$fullPath);		
			foreach($contents as $key=&gt;$value){
				if(!is_dir(basename($value))){
					ftp_site($conn_id, 'CHMOD 0777 '.$value);
					ftp_delete($conn_id,$value);
				}
			}
			ftp_chdir($conn_id,$parentDir);		
			if(ftp_rmdir($conn_id,$nameDir)) {    
				return true;   
			}else{   
				if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPath)){       
					if(ftp_rmdir($conn_id,$nameDir)) {    
						return true;   
					}else{   
						return false;    
					}   
				}else{   
					return false;    
				}          
			}      	
		}else{
			if(ftp_rmdir($conn_id,$nameDir)) {    
				return true;   
			}else{   
				if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPath)){       
					if(ftp_rmdir($conn_id,$nameDir)) {    
						return true;   
					}else{   
						return false;    
					}   
				}else{   
					return false;    
				}          
			}      		
		}
    }      
}   
  
// ฟังก์ชันสำหรับเปลี่ยนชื่อ Directory หรือ Folder   
function ftpRenameDir($conn_id,$parentDir,$nameDir,$newNameDir){         
    $fullPath=$parentDir.$nameDir;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    ftp_chdir($conn_id,$parentDir);    
    if($isDir){   
        if(ftp_rename($conn_id,$nameDir,$newNameDir)) {    
            return true;   
        }else{   
            if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPath)){       
                if(ftp_rename($conn_id,$nameDir,$newNameDir)) {    
                    return true;   
                }else{   
                    return false;    
                }   
            }else{   
                return false;    
            }          
        }      
    }      
}   
    

// ฟังก์ชันสำหรับกำหนด permissions     ไฟล์    
function ftpChmodFile($conn_id, $permissions,$parentDir,$nameDir,$fileName){           
	$fullPath=$parentDir.$nameDir;    
    $fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
        if(ftp_site($conn_id, 'CHMOD '.$permissions.' '.$fullPathFile) !== false){         
            return true;         
        }else{      
            return false;         
        }          
    }           
}     	

// ฟังก์ชันสำหรับเปลี่ยนชื่อ ไฟล์ 
function ftpRenameFile($conn_id,$parentDir,$nameDir,$fileName,$new_fileName){         
    $fullPath=$parentDir.$nameDir;    
	$fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
        if(ftp_rename($conn_id,$fileName,$new_fileName)) {    
            return true;   
        }else{   
            if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPathFile)){       
                if(ftp_rename($conn_id,$fileName,$new_fileName)) {    
                    return true;   
                }else{   
                    return false;    
                }   
            }else{   
                return false;    
            }          
        }      
    }      
}   	

// ฟังก์ชันสำหรับหาขนาดไฟล์
function ftpFileSize($conn_id,$parentDir,$nameDir,$fileName){         
    $fullPath=$parentDir.$nameDir;    
	$fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
        if(ftp_size($conn_id,$fileName)!=-1) {    
            return ftp_size($conn_id,$fileName);
        }else{   
			return  false;
        }      
    }      
}   	
	
// ฟังก์ชันสำหรับหา ว่ามีไฟล์ชื่อนี้หรือไม่
function ftpIsFile($conn_id,$parentDir,$nameDir,$fileName){         
    $fullPath=$parentDir.$nameDir;    
	$fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
        if(ftp_size($conn_id,$fileName)!=-1) {    
            return true;
        }else{   
			return  false;
        }      
    }      
}  	
	
// ฟังก์ชันสำหรับอัพโหลดไฟล์
function ftpUploadFile($conn_id,$parentDir,$nameDir,$fileName,$uploadFile){         
    $fullPath=$parentDir.$nameDir;    
	$fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
		if(ftp_put($conn_id, $fileName,$uploadFile,FTP_ASCII)){
			if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPathFile)){
				return true;
			}else{
				return false;
			}			
		}else{
			return false;
		}
    }      
}   		
	
// ฟังก์ชันสำหรับลบ ไฟล์
function ftpRemoveFile($conn_id,$parentDir,$nameDir,$fileName){         
    $fullPath=$parentDir.$nameDir;    
	$fullPathFile=$parentDir.$nameDir."/".$fileName;    
	$isDir=ftp_chdir($conn_id,$fullPath);
    if($isDir){   
		if(ftp_delete($conn_id,$fileName)){
			return true;
		}else{
           if(ftp_site($conn_id, 'CHMOD 0777 '.$fullPathFile)){       
                if(ftp_delete($conn_id,$fileName)) {    
                    return true;   
                }else{   
                    return false;    
                }   
            }else{   
                return false;    
            }    		
		}
    }      
}   	
	
// ฟังก์ชันปิดการเชื่อมต่อ Server ผ่าน FTP         
function ftpClose($conn_id){         
    ftp_close($conn_id);         
}         
?&gt;      
</pre>

<p>ตัวอย่างการใช้งาน</p>
<pre name="code" class="php:controls">
&lt;?php    
include("config_ftp.php");
$parentDir="/domains/youdomain.com/public_html/test/"; // Directory หลักสำหรับจัดการ
$nameDir="folder1"; // ฃื่อ Directory ที่ต้องการสร้าง, กำหนด permissions, ลบ, หรือเปลี่ยนชื่อ
$newNameDir="myNewFolder";  // ชื่อ Directory ใหม่กรณีเปลี่ยนชื่อ Directory

$conn_id = ftpOpen();      // เปิดการเชื่อมต่อผ่าน FTP     
if($conn_id){   
	// ฟังก์ชันสำหรับกำหนด permissions     
	ftpChmod($conn_id, $permissions,$parentDir,$nameDir);     
	// ตัวอย่าง   ftpChmod($conn_id, "0777",$parentDir,$nameDir);
	
	// ฟังก์ชันสำหรับสร้าง Directory หรือ Folder   
	ftpMakeDir($conn_id,$parentDir,$nameDir);  
	// ตัวอย่าง   ftpMakeDir($conn_id,$parentDir,$nameDir);    
	
	// ฟังก์ชันสำหรับลบ Directory หรือ Folder (ข้อระวัง* หากมีไฟล์ภายใน ระบบจะลบไฟล์ทั้งหมดใน Folder)   
	ftpRemoveDir($conn_id,$parentDir,$nameDir);     
	// ตัวอย่าง  ftpRemoveDir($conn_id,$parentDir,$nameDir);       
	
	// ฟังก์ชันสำหรับเปลี่ยนชื่อ Directory หรือ Folder   
	ftpRenameDir($conn_id,$parentDir,$nameDir,$newNameDir);      
	// ตัวอย่าง  ftpRenameDir($conn_id,$parentDir,$nameDir,$newNameDir);      
	
	// ฟังก์ชันสำหรับเปลี่ยนชื่อ ไฟล์ 
	ftpRenameFile($conn_id,$parentDir,$nameDir,$fileName,$new_fileName);      
	// ตัวอย่าง  ftpRenameFile($conn_id,$parentDir,$nameDir,$fileName,$new_fileName);         
	
	// ฟังก์ชันสำหรับหาขนาดไฟล์
	ftpFileSize($conn_id,$parentDir,$nameDir,$fileName);       
	// ตัวอย่าง  ftpFileSize($conn_id,$parentDir,$nameDir,$fileName);      
	
	// ฟังก์ชันสำหรับหา ว่ามีไฟล์ชื่อนี้หรือไม่
	ftpIsFile($conn_id,$parentDir,$nameDir,$fileName);  
	// ตัวอย่าง  ftpIsFile($conn_id,$parentDir,$nameDir,$fileName);         
	
	// ฟังก์ชันสำหรับอัพโหลดไฟล์
	ftpUploadFile($conn_id,$parentDir,$nameDir,$fileName,$uploadFile);     
	// ตัวอย่าง  ftpUploadFile($conn_id,$parentDir,$nameDir,$_FILES['file']['name'],$_FILES['file']['tmp_name']);        
	
	// ฟังก์ชันสำหรับลบ ไฟล์
	ftpRemoveFile($conn_id,$parentDir,$nameDir,$fileName);      
	// ตัวอย่าง  ftpRemoveFile($conn_id,$parentDir,$nameDir,$fileName);      

	ftpClose($conn_id);      // ปิดการติดต่อผ่าน FTP     
}   
?&gt;   
</pre>]]></description><pubDate>Wed, 10 Feb 2010 02:28:08 +0700</pubDate></item><item><title>ทบทวน javascript ฟังก์ชั่น ให้กรอกเฉพาะภาษาอังกฤษเท่านั้น</title><link>http://www.ninenik.com/ทบทวน_javascript_ฟังก์ชั่น_ให้กรอกเฉพาะภาษาอังกฤษเท่านั้น-257.html</link><description><![CDATA[<p>Javascript Code</p>
<pre name="code" class="javascript:controls">
&lt;script type="text/javascript"&gt; 
function isEnglishchar(str){   
	var orgi_text="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890._-";   
	var str_length=str.length;   
	var isEnglish=true;   
	var Char_At="";   
	for(i=0;i&lt;str_length;i++){   
		Char_At=str.charAt(i);   
		if(orgi_text.indexOf(Char_At)==-1){   
			isEnglish=false;   
			break;
		}      
	}   
	return isEnglish; 
}  
&lt;/script&gt;
</pre>

<p>การใช้งาน</p>
<pre name="code" class="javascript:controls">
&lt;script type="text/javascript"&gt; 
var str="ทดสอบ";
if(isEnglishchar(str)==false){
	alert("กรุณากรอกข้อมูลเป็นภาษาอังกฤษเท่านั้น");
	return false;
}
&lt;/script&gt;
</pre>]]></description><pubDate>Wed, 03 Feb 2010 00:54:49 +0700</pubDate></item><item><title>หมุน สลับ แบนเนอร์ในแนวนอน ด้วย jQuery อย่างง่าย</title><link>http://www.ninenik.com/หมุน_สลับ_แบนเนอร์ในแนวนอน_ด้วย_jQuery_อย่างง่าย-256.html</link><description><![CDATA[<p>ตัวอย่าง</p>
<p><style type="text/css">
div.containBanner{
	position:relative;
	display:block;
	background-color:#33CCFF;
	overflow:hidden;
}
ul.areaBanner,ul.areaBanner li{
	list-style:none;
	margin:0;
	padding:0;
}
ul.areaBanner{
	position:absolute;
	left:0;
	top:0;
	display:block;
	white-space:nowrap;
}
ul.areaBanner li{
	position:relative;
	display:block;
	float:left;
}</style></p>
<div class="containBanner">
<ul class="areaBanner">
    <li style="background-color: #3399cc">&nbsp;</li>
    <li style="background-color: #66cccc">&nbsp;</li>
    <li style="background-color: #ffff99">&nbsp;</li>
    <li style="background-color: #99cc99">&nbsp;</li>
    <li style="background-color: #cc9999">&nbsp;</li>
</ul>
</div>
<script type="text/javascript">
$(function(){
	var timeSwap=2000;
	var listWidth=250;
	var listHeight=100;
	var areaWidth=$("ul.areaBanner li").length*listWidth;
	var a_banner=1;
	var runIT=function(){
		a_banner=(a_banner>=$("ul.areaBanner li").length)?0:a_banner;
		var norwLeft=$("ul.areaBanner li").offset().left;
		norwLeft=a_banner*listWidth;
		$("ul.areaBanner li").animate({
			left:-norwLeft
		},500);
		a_banner++;
	}
	var bannerSwap=function(){
		$("div.containBanner").width(listWidth).height(listHeight);
		$("ul.areaBanner li").width(listWidth).height(listHeight);
		$("ul.areaBanner").width(areaWidth);
		setInterval(function(){
			runIT();
		},timeSwap);	
	}
	bannerSwap();
});
</script>
<p>CSS code ตัวอย่าง</p>
<pre class="css:controls" name="code">
&lt;style type=&quot;text/css&quot;&gt;
div.containBanner{
	position:relative;
	display:block;
	top:80px;
	left:150px;	
	background-color:#33CCFF;
	overflow:hidden;
}
ul.areaBanner,ul.areaBanner li{
	list-style:none;
	margin:0;
	padding:0;
}
ul.areaBanner{
	position:absolute;
	left:0;
	top:0;
	display:block;
	white-space:nowrap;
}
ul.areaBanner li{
	position:relative;
	display:block;
	float:left;
}
&lt;/style&gt;
</pre>
<p>HTML code ตัวอย่าง</p>
<pre class="html:controls" name="code">
&lt;div class=&quot;containBanner&quot;&gt;
&lt;ul class=&quot;areaBanner&quot;&gt;
&lt;li style=&quot;background-color:#3399CC;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;background-color:#66CCCC;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;background-color:#FFFF99;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;background-color:#99CC99;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;background-color:#CC9999;&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>jQuery ตัวอย่าง</p>
<pre class="javascript:controls" name="code">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.4.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	var timeSwap=2000;
	var listWidth=250;
	var listHeight=100;
	var areaWidth=$(&quot;ul.areaBanner li&quot;).length*listWidth;
	var a_banner=1;
	var runIT=function(){
		a_banner=(a_banner&gt;=$(&quot;ul.areaBanner li&quot;).length)?0:a_banner;
		var norwLeft=$(&quot;ul.areaBanner li&quot;).offset().left;
		norwLeft=a_banner*listWidth;
		$(&quot;ul.areaBanner li&quot;).animate({
			left:-norwLeft
		},500);
		a_banner++;
	}
	var bannerSwap=function(){
		$(&quot;div.containBanner&quot;).width(listWidth).height(listHeight);
		$(&quot;ul.areaBanner li&quot;).width(listWidth).height(listHeight);
		$(&quot;ul.areaBanner&quot;).width(areaWidth);
		setInterval(function(){
			runIT();
		},timeSwap);	
	}
	bannerSwap();
});
&lt;/script&gt;
</pre>]]></description><pubDate>Tue, 02 Feb 2010 02:37:51 +0700</pubDate></item><item><title>การใช้งาน method  delay() ใน jQuery 1.4</title><link>http://www.ninenik.com/การใช้งาน_method__delay()_ใน_jQuery_1.4-255.html</link><description><![CDATA[<p><strong>&nbsp;.delay()<br />
</strong>ใช้สำหรับหน่วงเวลาในการเรียกใช้งานฟังก์ชันที่อยู่ในลำดับ queue</p>
<div><strong>รูปแบบการใช้งาน</strong></div>
<div><strong>.delay( duration, [ queueName ] )&nbsp;</strong></div>
<div>ค่าในปีกกาสี่เหลี่ยมเป็นตัวเลือกเพิ่มเติมหรือ option &nbsp;จะกำหนดค่าหรือไม่กำหนดก็ได้</div>
<div><strong>duration </strong>คือ เวลาสำหรับการหน่วง โดย 1000 เท่ากับ 1 วินาที ค่ายิ่งมากหมายถึงการเรียกใช้ฟังก์ชั่นถัดไปจะยิ่งช้าลง&nbsp;</div>
<div>&nbsp;</div>
<div>สามารถกำหนดเป็นข้อความ fast (มีค่าเท่ากับ 200) หรือ slow (มีค่าเท่ากับ 600)&nbsp;</div>
<div><strong>queueName </strong>คือ ข้อความที่แสดงชื่อของ queue หากไม่กำหนด ค่าเริ่มต้นจะเป็น fx</div>
<div>
<p>CSS code ตัวอย่าง</p>
<pre name="code" class="css:controls">
&lt;style type=&quot;text/css&quot;&gt;
div#DivA,div#DivB{
	display:block;
	position:relative;
	width:50px;
	height:50px;
}
div#DivA{
	background-color:#CC99FF;
}
div#DivB{
	background-color:#FFCC33;
}
&lt;/style&gt;
</pre>
<p>HTML code ตัวอย่าง</p>
<pre name="code" class="html:controls">
&lt;div id=&quot;DivA&quot;&gt;Div A&lt;/div&gt;
&lt;div id=&quot;DivB&quot;&gt;Div B&lt;/div&gt;
&lt;input type=&quot;button&quot; name=&quot;testIT&quot; id=&quot;testIT&quot; value=&quot;Test&quot; /&gt;
</pre>
<p>jQuery code ตัวอย่าง</p>
<pre name="code" class="javascript:controls">
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	$(&quot;input#testIT&quot;).click(function(){
		$(&quot;div#DivA&quot;).animate({left:'300px'},1200).delay(600).animate({left:0},1200);
		$(&quot;div#DivB&quot;).animate({left:'300px'},1200).animate({left:0},1200);
	});
});
&lt;/script&gt;
</pre>
<script type="text/javascript">
$(function(){
	$("input#testIT").click(function(){
		$("div#DivA").animate({left:'300px'},1200).delay(600).animate({left:0},1200);
		$("div#DivB").animate({left:'300px'},1200).animate({left:0},1200);
	});
});
</script>
<p>ตัวอย่าง</p>
<p><iframe width="100%" height="230" scrolling="no" frameborder="0" src="demo/jquery_delay.php"></iframe></p>
<div><strong>คำธิบายตัวอย่าง</strong></div>
<div>divA และ divB มีการเคลื่อนไหวเกิดขึ้นสองช่วง</div>
<div>ช่วงที่ 1 divA และ divB เคลื่อนออกจากด้านซ้ายเดิมเท่ากับ 300 pixels ภายในเวลา 1200 มิลลิวินาทีหรือ 1 วินาที่ 200 มิลลิวินาที</div>
<div>ช่วงที่ 2 divA และ divB จะเคลื่อนกลับมายังตำแหน่งเดิมภายในเวลา 1200 มิลลิวินาทีหรือ 1 วินาที่ 200 มิลลิวินาทีเท่าเดิม</div>
<div>&nbsp;</div>
<div>แต่กรณีความแตกต่างของ divA เมื่อมีการเรียกใช้ method .delay() จะทำให้การเคลื่อนไหวใน ช่วงที่ 2 ของ divA ช้ากว่าของ divB เท่ากับจำนวนเวลาที่กำหนด จากตัวอย่่าง เท่ากับ 600 มิลลิวินาที</div>
<div>&nbsp;</div>
</div>]]></description><pubDate>Mon, 01 Feb 2010 15:09:05 +0700</pubDate></item><item><title>การใช้งาน jQuery.contains() ใน jQuery 1.4 </title><link>http://www.ninenik.com/การใช้งาน_jQuery.contains()_ใน_jQuery_1.4_-254.html</link><description><![CDATA[<p><strong>jQuery.contains()</strong><br />
ใช้สำหรับตรวจสอบว่ามี DOM 0bject หนึ่งอยู่ในอีก DOM Object หนึ่งหรือไม่ เช่น มีแท็ก li อยู่ในแท็ก div หรือไม่</p>
<p><strong>รูปแบบการใช้งาน</strong><br />
<strong>jQuery.contains( container, contained ) </strong><br />
หรือ<br />
<strong>$.contains( container, contained ) </strong><br />
คืนค่าเป็น true หรือ false (จากการทดสอบ จะคืนค่าเป็น 16 ถ้าเป็นจริง และเป็น 0 ถ้าเป็นเท็จ)<br />
container คือ DOM Object ที่มี DOM Object ตัวอื่นอยู่ภายใน หรือ ตัวที่คลุม DOM Object ตัวอื่นอยู่<br />
contained คือ DOM Object  ที่บรรจุอยู่ใน DOM Object  ตัวอื่น </p>
<p><strong>CSS Code ตัวอย่าง</strong></p>
<pre name="code" class="css:controls">
&lt;style type="text/css"&gt;
div#containTest{
    background-color:#FFFFCC;
    padding:5px;
}
ul#testList{
    background-color:#FFCCCC;
}
&lt;/style&gt;
</pre>
<p><strong>HTML Code ตัวอย่าง</strong></p>
<pre name="code" class="html:controls">
&lt;div id="containTest"&gt;
&lt;ul id="testList"&gt;
&lt;li&gt;list 1&lt;/li&gt;
&lt;li&gt;list 2&lt;/li&gt;
&lt;li&gt;list 3&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span&gt;&lt;/span&gt;
&lt;input type="button" name="case_no1" id="case_no1" value="เช็คว่ามี li อยู่ใน div" /&gt;
&lt;input type="button" name="case_no2" id="case_no2" value="เช็คว่ามี span อยู่ใน div" /&gt;
</pre>
<p><strong>jQuery Code ตัวอย่าง</strong></p>
<pre name="code" class="javascript:controls">
&lt;script type="text/javascript" src="js/jquery-1.4.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(function(){
    $("input#case_no1").click(function(){
        var logVar=$.contains($("div#containTest").get(0),$("li").get(0));
        if(logVar){
            alert("Yes");
        }else{
            alert("No");
        }
    });
    $("input#case_no2").click(function(){
    var logVar=$.contains($("div#containTest").get(0),$("span").get(0));
        if(logVar){
            alert("Yes");
        }else{
            alert("No");
        }
    }); 
});
&lt;/script&gt;
</pre>

<p><strong>ตัวอย่าง</strong></p>
<iframe width="100%" height="230" scrolling="no" frameborder="0" src="demo/jquery_contains.php"></iframe>]]></description><pubDate>Wed, 27 Jan 2010 18:53:39 +0700</pubDate></item><item><title>การใช้งาน method .clearQueue()  ใน jQuery 1.4  javascript library เวอร์ชั่นล่าสุด</title><link>http://www.ninenik.com/การใช้งาน_method_.clearQueue()__ใน_jQuery_1.4__javascript_library_เวอร์ชั่นล่าสุด-252.html</link><description><![CDATA[<p>ดาวน์โหลดไฟล์ js เวอร์ฃั่นล่าสุดได้ที่เว็บไซต์ <a target="_blank" href="http://jquery.com/">http://jquery.com/</a></p>
<p><strong>.clearQueue()</strong><br />
ใช้สำหรับยกเลิกฟังก์ชั่นใดๆ ก็ตามที่อยู่ใน method .queue()<br />
<strong>รูปแบบการใช้งาน</strong> <br />
.clearQueue( [ queueName ] )<br />
queueName คือ ข้อความที่แสดงชื่อของ queue หากไม่กำหนด ค่าเริ่มต้นจะเป็น fx<br />
<br />
เมื่อมีการเรียกใช้ method .clearQueue() จะทำให้ฟังก์ชั่นใดๆ ก็ตามที่อยู่ใน method .queue()  จะถูกยกเลิก หากเรียกใช้งาน .clearQueue() โดยไม่ได้กำหนดค่่า อาร์กิวเมนต์ หรือ queueName จะเป็นการยกเลิก ฟังก์ชั่นทั้งหมดจาก queueName ที่ชื่อ fx ชื่องเป็นค่าเริ่มต้น <br />
</p>
<p><strong>CSS code ตัวอย่าง</strong></p>
<pre name="code" class="css:controls">
&lt;style type=&quot;text/css&quot;&gt;
div#testit{
width:35px;
height:35px;
border:1px solid #EAEAEA;
background-color:#99CC99;
position:relative;
display:none;
}
&lt;/style&gt;
</pre>
<p><strong>HTML code ตัวอย่าง</strong></p>
<pre name="code" class="html:controls">
&lt;div id=&quot;testit&quot;&gt;&lt;/div&gt;
</pre>
<p><strong>jQuery Code ตัวอย่าง</strong></p>
<pre name="code" class="javascript:controls">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.4.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	var leftIT=$(&quot;div#testit&quot;).offset().left;
	$(&quot;#start&quot;).click(function(){
		$(&quot;div#testit&quot;).show(&quot;slow&quot;);
		$(&quot;div#testit&quot;).animate({left:'+=200'},5000);
		$(&quot;div#testit&quot;).queue(function(){
			$(this).css({
				&quot;border&quot;:&quot;1px solid #FFFF99&quot;,
				&quot;background-color&quot;:&quot;#FFCC33&quot;
			});
		});	
	});
	$(&quot;#stop1&quot;).click(function(){
		$(&quot;div#testit&quot;).stop();
	});
	$(&quot;#stop2&quot;).click(function(){
		$(&quot;div#testit&quot;).stop(true);
	});	
	$(&quot;#stop3&quot;).click(function(){
		$(&quot;div#testit&quot;).clearQueue();
	});
	$(&quot;#stop4&quot;).click(function(){
		$(&quot;div#testit&quot;).clearQueue().stop();
	});		
	$(&quot;#Reset&quot;).click(function(){
		$(&quot;div#testit&quot;).css({
			&quot;left&quot;:leftIT,
			&quot;width&quot;:&quot;35px&quot;,
			&quot;height&quot;:&quot;35px&quot;,
			&quot;border&quot;:&quot;1px solid #EAEAEA&quot;,
			&quot;background-color&quot;:&quot;#99CC99&quot;,
			&quot;position&quot;:&quot;relative&quot;,
			&quot;display&quot;:&quot;none&quot;
		});
		$(&quot;div#testit&quot;).clearQueue().stop();
	});
});
&lt;/script&gt;
</pre>
<br />
<div id="testit">&nbsp;</div>
<br />
<p><input type="button" name="start" id="start" value="Start" /> <input type="reset" name="Reset" id="Reset" value="Reset" /> <br />
<input type="button" name="stop1" id="stop1" value=" .stop() method" /> ยกเลิกการ animate แต่ฟังก์ชันใน method .queue() ยังคงอยู่ และทำงาน<br />
<input type="button" name="stop2" id="stop2" value=" .stop(true) method" />ยกเลิกการ animate และฟังก์ชันใน method .queue() ถูกยกเลิก<br />
<input type="button" name="stop3" id="stop3" value=" .clearQueue() method" /> การ animate ยังคงอยู่ แต่ฟังก์ชันใน method .queue() ถูกยกเลิก<br />
<input type="button" name="stop4" id="stop4" value=" .clearQueue().stop() method" /> ยกเลิกการ animate และฟังก์ชันใน method .queue() ถูกยกเลิก<br />
<br />
<br />
<script type="text/javascript">
$(function(){
	var leftIT=$("div#testit").offset().left;
	$("#start").click(function(){
		$("div#testit").show("slow");
		$("div#testit").animate({left:'+=200'},5000);
		$("div#testit").queue(function(){
			$(this).css({
				"border":"1px solid #FFFF99",
				"background-color":"#FFCC33"
			});
		});	
	});
	$("#stop1").click(function(){
		$("div#testit").stop();
	});
	$("#stop2").click(function(){
		$("div#testit").stop(true);
	});	
	$("#stop3").click(function(){
		$("div#testit").clearQueue();
	});
	$("#stop4").click(function(){
		$("div#testit").clearQueue().stop();
	});		
	$("#Reset").click(function(){
		$("div#testit").css({
			"left":leftIT,
			"width":"35px",
			"height":"35px",
			"border":"1px solid #EAEAEA",
			"background-color":"#99CC99",
			"position":"relative",
			"display":"none"
		});
		$("div#testit").clearQueue().stop();
	});
});
</script> <style type="text/css">
div#testit{
width:35px;
height:35px;
border:1px solid #EAEAEA;
background-color:#99CC99;
position:relative;
display:none;
}
</style></p>]]></description><pubDate>Tue, 26 Jan 2010 23:50:09 +0700</pubDate></item><item><title>รู้จัก property position ของ css ให้มากขึ้น ด้วย ตัวอย่าง และคำอธิบาย</title><link>http://www.ninenik.com/รู้จัก_property_position_ของ_css_ให้มากขึ้น_ด้วย_ตัวอย่าง_และคำอธิบาย-251.html</link><description><![CDATA[<p><style type="text/css">
div.exampleDiv1{
	width:250px;
	height:150px;
	display:block;
	background-color:#FFCCCC;
}
div.exampleDiv2{
	width:250px;
	height:150px;
	display:block;
	background-color:#CCFF99;
}
div.exampleDiv3{
	width:500px;
	height:450px;
	display:block;
	background-color:#FFFFCC;
}</style><script type="text/javascript">
$(function(){
	$("select#Div1Set,input#Lpx,input#Tpx").bind("change click",function(){
			var selectVal=$("select#Div1Set").val();
			$("div.exampleDiv1").css({
				"position":selectVal,
				"left":$("input#Lpx").val()+"px",
				"top":$("input#Tpx").val()+"px"
			});
			$("div.exampleDiv1 > pre").html("div.exampleDiv1{<br>&nbsp;&nbsp;position:"+selectVal+";<br>&nbsp;&nbsp;left:"+$("input#Lpx").val()+"px;<br>&nbsp;&nbsp;top:"+$("input#Tpx").val()+"px;<br>}");
	});
	$("select#Div2Set,input#Lpx2,input#Tpx2").bind("change click",function(){
			var selectVal=$("select#Div2Set").val();
			$("div.exampleDiv2").css({
				"position":selectVal,
				"left":$("input#Lpx2").val()+"px",
				"top":$("input#Tpx2").val()+"px"
			});
			$("div.exampleDiv2 > pre").html("div.exampleDiv1{<br>&nbsp;&nbsp;position:"+selectVal+";<br>&nbsp;&nbsp;left:"+$("input#Lpx2").val()+"px;<br>&nbsp;&nbsp;top:"+$("input#Tpx2").val()+"px;<br>}");
	});	
	$("select#Div3Set").bind("change",function(){
			var selectVal=$("select#Div3Set").val();
			$("div.exampleDiv3").css("position",selectVal);
	});		
});
</script><br />
<br />
&nbsp;</p>
<div class="exampleDiv3">
<div class="exampleDiv1">div.exampleDiv1
<pre>
div.exampleDiv1{

}
</pre>
</div>
<div class="exampleDiv2">div.exampleDiv2
<pre>
div.exampleDiv1{

}
</pre>
</div>
<span style="background-color: #ffcc99">Span</span></div>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 10px; background-color: #fdfdfd; margin: auto; padding-left: 10px; width: 500px; padding-right: 10px; font-size: 12px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 10px">Div1 <select id="Div1Set" name="Div1Set">
<option value="static" selected="selected">กำหนด Div1 position เป็น static</option>
<option value="absolute">กำหนด Div1 position เป็น absolute</option>
<option value="fixed">กำหนด Div1 position เป็น fixed</option>
<option value="relative">กำหนด Div1 position เป็น relative</option>
</select> Left:<input id="Lpx" size="5" name="Lpx" value="0" type="text" /> Top:<input id="Tpx" size="5" name="Tpx" value="0" type="text" /> <br />
Div2 <select id="Div2Set" name="Div2Set">
<option value="static" selected="selected">กำหนด Div2 position เป็น static</option>
<option value="absolute">กำหนด Div2 position เป็น absolute</option>
<option value="fixed">กำหนด Div2 position เป็น fixed</option>
<option value="relative">กำหนด Div2 position เป็น relative</option>
</select> Left:<input id="Lpx2" size="5" name="Lpx2" value="0" type="text" /> Top:<input id="Tpx2" size="5" name="Tpx2" value="0" type="text" /><br />
Div3 <select id="Div3Set" name="Div3Set">
<option value="static" selected="selected">กำหนด Div3 position เป็น static</option>
<option value="absolute">กำหนด Div3 position เป็น absolute</option>
<option value="fixed">กำหนด Div3 position เป็น fixed</option>
<option value="relative">กำหนด Div3 position เป็น relative</option>
</select><br />
&nbsp;</div>
<ul>
    <li><strong>position:static;</strong> เป็นค่าเริ่มต้น จะกำหนดหรือไม่กำหนดก็ได้ ปกติถ้ากำหนดจะใช้เมื่อทำการ override หรือกรณีต้องการล้างค่าที่กำหนดก่อนหน้า จากค่าอื่นเช่น fixed , absolute หรือ relative <br />
    <strong>position:static;</strong> จะไม่รองรับการกำหนดค่า left , top, right และ bottom</li>
    <li><strong>position:relative;</strong>เป็นการกำหนดตำแหน่งที่อิงความสัมพันธ์กับตำแหน่งเดิม เช่น div1 กำหนด position เป็น relative และกำหนด left:20px; ผลลัพธ์คือ div1 จากเลื่อนออกจากตำแหน่งเดิมทางซ้าย 20 pixels<br />
    ข้อมูลหรือเนื้อหาที่อยู่ใน element ที่กำหนด position เป็น relative สามารถที่จะเลื่อนและอยู่วางซ้อนเหนือ elements ตัวอื่นได้ แต่จะเกิดพื้นที่ว่างจากเนื้อหาหรือข้อมูลขึ้นในตำแหน่งเดิม<br />
    <strong>position:relative;</strong>จะใช้บ่อยสำหรับบรรจุบล็อกของ elements ที่กำหนด position เป็น absolute<br />
    &nbsp;</li>
    <li>
    <p><strong>position:absolute;</strong> จะกำหนดตำแหน่งโดยอิงกับตำแหน่ง parent ตัวแรก ที่กำหนด position เป็นค่าอื่นที่ไม่ใช่ static <br />
    ตัวอย่าง ถ้า div1 อยู่ใน div2 หมายถึง div2 เป็น parent ของ div1<br />
<pre name="code" class="html:controls">
    &lt;div id=&quot;div2&quot;&gt;
    &lt;div id=&quot;div1&quot;&gt;

    &lt;/div&gt;
    &lt;/div&gt;
</pre>
    ถ้า div1 อยู่ใน div2 และ div2 อยู่ใน div3 หมายถึง div2 และ div3 เป็น parent ของ div1<pre name="code" class="html:controls">
    &lt;div id=&quot;div3&quot;&gt;
    &lt;div id=&quot;div2&quot;&gt;
    &lt;div id=&quot;div1&quot;&gt;

    &lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
</pre>
    หาก div3 มีการกำหนด position เป็น relative,absolute หรือ fiexd (ยกเว้น static)<br />
    และเมื่อกำหนด div1 position เป็น absolute ดังนั้นตำแหน่างของ div1 จะอิงความสัมพันธ์<br />
    กับตำแหน่งของ div3 ซึ่งเป็น parent ตัวแรกที่เข้าเงื่อนไข</p>
    <p>กรณีไม่มี parent ใดๆ ที่เข้าเงื่อนไข ตำแหน่งของ div1 ที่กำหนด position เป็น absolute จะอิงกับ &lt;html&gt; หรือ ขอบด้านในของบราวเซอร์</p>
    <p><strong>position:absolute;</strong> สามารถที่จะซ้อนทับกันได้ โดยใช้ร่วมกับ z-index เพื่อกำหนดตำแหน่งบน ล่าง</p>
    </li>
    <li><strong>position:fixed; </strong>.ใช้กำหนดตำแหน่งของ element โดยอิงความสัมพันธ์กับตำแหน่งขอบด้านในของบราวเซอร์ และจะไม่เคลื่อนเมื่อมีการเลื่อน scrollbar <br />
    ถ้ากำหนด position ของ div1 เป็น fixed และกำหนด left:45px;top;100px; ตำแหน่งของ div1 จะขยับออกจากด้านซ้ายของขอบด้านในของเบราวเซอร์ 45 pixels และขยับออกจากด้านบนของขอบด้านในของบราวเซอร์เท่ากับ 100 pixels</li>
</ul>]]></description><pubDate>Thu, 14 Jan 2010 04:48:29 +0700</pubDate></item><item><title>ดึงไฟล์ xml (rss) ไฟล์แบบ cross domain มาแสดงด้วย ajax ใน jQuery อย่างง่าย</title><link>http://www.ninenik.com/ดึงไฟล์_xml_(rss)_ไฟล์แบบ_cross_domain_มาแสดงด้วย_ajax_ใน_jQuery_อย่างง่าย-250.html</link><description><![CDATA[<p>&nbsp;การดึง ข้อมูลจาก xml ไฟล์มาใช้ในเว็บ จะใช้ข้อมูลประมาณ 3 - 4 ข้อมูล ได้แก่&nbsp;</p>
<div>1.หัวข้อ title&nbsp;</div>
<div>2.ลิ้งค์ที่อยู่ url&nbsp;</div>
<div>3.รูปภาพประกอบ image</div>
<div>4.วันที่ date</div>
<div>&nbsp;</div>
<div>
<div>แต่ในที่นี่จะแสดงตัวอย่างการดึงข้อมูล 2 ข้อมูลมาแสดง คือ หัวข้อ title และ ลิ้งค์ที่อยู่ url</div>
<div>โดยสามารถทำตามขั้นตอน ได้ดังต่อไปนี้</div>
<div>1.สรัางไฟล์ php เรียก ข้อมูล xml มาแสดง ชื่อ gXML.php</div>
<pre name="code" class="php:controls">
&lt;?php
if(isset($_GET['url'])){
header(&quot;Content-type:text/xml; charset=UTF-8&quot;);   
header(&quot;Cache-Control: no-store, no-cache, must-revalidate&quot;);      
header(&quot;Cache-Control: post-check=0, pre-check=0&quot;, false);  
echo $gXML=file_get_contents($_GET['url']);
exit;
}
?&gt;</pre>
<div>2.HTML code ในไฟล์สำหรับ แสดงข้อมูล</div>
<pre name="code" class="html:controls">
&lt;div id=&quot;showRSS&quot;&gt;
&lt;ul&gt;

&lt;/ul&gt;
&lt;/div&gt;
</pre>
<div>3.Javascript Code สำหรับดึงข้อมูล</div>
<pre name="code" class="javascript:controls">
&lt;script src=&quot;http://www.google.com/jsapi&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
	var gXML=$.ajax({
		url: &quot;gXML.php?url=http://www.ninenik.com/rss2.xml&quot;,
		async: false, 
		success:function(gXML){ 	
			var NumItem=$(gXML).find(&quot;item&quot;).length; 
			var titleRSS=null;
			var linkRSS=null;
			for(var i=0;i&lt;NumItem;i++){
				titleRSS=$(gXML).find(&quot;item title&quot;).eq(i).text();
				linkRSS=$(gXML).find(&quot;item link&quot;).eq(i).text();
				$(&quot;div#showRSS ul&quot;).append(&quot;&lt;li&gt;&lt;a href='&quot;+linkRSS+&quot;' target='_blank'&gt;&quot;+titleRSS+&quot;&lt;/a&gt;&lt;/li&gt;&quot;);
			}
		}
	}).responseText;
});
</pre>
<div><strong>คำอธิบาย</strong></div>
<div>
<div>บรรทัดที่ 8 กำหนด url ของ xml ไฟล์ที่ต้องการนำมาแสดง</div>
<div>บรรทัดที่ 11 กำหนดตัวแปรเก็บจำนวนรายการทั้งหมด สามารถกำหนดเป็นตัวเลขที่ต้องการแสดงได้</div>
<div>บรรทัดที่ 12 กำหนดตัวแปรเก็บหัวเรื่อง</div>
<div>บรรทัดที่ 13 กำหนดตัวแปรเก็บ url</div>
<div>บรรทัดที่ 14 วนลูปแสดงรายการใน xml</div>
<div>บรรทัดที่ 15 ดึงข้อมูลหัวข้อจาก xml ไฟล์เก็บในตัวแปร titleRSS</div>
<div>บรรทัดที่ 16 ดึงข้อมูล url สำหรับลิ้งค์ มาเก็บในตัวแปร linkRSS</div>
<div>บรรทัดที่ 17 แสดงข้อมูลใน div</div>
<div>&nbsp;</div>
<div>ทั้งหมดนี้ สามารถนำไปประยุกต์ใช้ กับ xml ไฟล์ที่ไม่ใช่ rss &nbsp;ได้</div>
<div>&nbsp;</div>
</div>
<div>หากต้องการปรับแต่งการแสดงผล สามารถกำหนด โดยแทรก css code ตัวไปนี้</div>
<div>&nbsp;</div>
<pre name="code" class="css:controls">
&lt;style type=&quot;text/css&quot;&gt;
/* style สำหรับ list รายการ */
div#showRSS ul,div#showRSS ul li{
	
}
/* style สำหรับ list รายการ */
div#showRSS ul li{

}
/* style สำหรับ link */
div#showRSS ul li a{
	font-family:Arial, &quot;times New Roman&quot;, tahoma;
	font-size:12px;
	color:#000000;	
	text-decoration:none;
}
/* style สำหรับ link เมื่อเมาส์อยู่เหนือ */
div#showRSS ul li a:hover{
	font-family:Arial, &quot;times New Roman&quot;, tahoma;
	font-size:12px;	
	font-weight:bold;
	color:#FF3300;
	background-color:#F5F5F5;
	text-decoration:none;
}
&lt;/style&gt;
</pre>
<div>&nbsp;ตัวอย่าง คลิก&nbsp;<a href="http://www.ninenik.com/demo/jquery_xml.php">http://www.ninenik.com/demo/jquery_xml.php</a></div>
<div>&nbsp;</div>
</div>]]></description><pubDate>Mon, 04 Jan 2010 20:22:41 +0700</pubDate></item><item><title>สร้าง watermark ลายน้ำ ให้กับช่อง สำหรับการค้นหา ด้วย jQuery และ CSS อย่างง่าย</title><link>http://www.ninenik.com/สร้าง_watermark_ลายน้ำ_ให้กับช่อง_สำหรับการค้นหา_ด้วย_jQuery_และ_CSS_อย่างง่าย-249.html</link><description><![CDATA[<p>ตัวอย่างผลลัพธ์</p>
<style type="text/css">
.watermark{
	background:url(http://www.google.com/cse/intl/en/images/google_site_search_watermark.gif) no-repeat 5px 2px;
}
</style>
<br>
<form id="form1" name="form1" method="post" action="">
  <input name="kw" type="text" id="kw" size="45" />
  <input type="submit" name="Sbt" id="Sbt" value="ค้นหา" />
</form>
<script type="text/javascript">
$(function(){
	var objKey="#kw";
	if($(objKey).val()==""){
			$(objKey).addClass("watermark");
	}	
	$(objKey).focus(function(){	 
		$(objKey).removeClass("watermark");			 
	}).blur(function(){
		if($(objKey).val()==""){
			$(objKey).addClass("watermark");
		}	
	});	
});
</script>
<p>CSS สำหรับกำหนดคุณสมบัติลายน้ำ ในที่ใช้รูปจาก google สำหรับทดสอบ สามารถแทนรูปภาพอื่นได้</p>
<pre name="code" class="css:controls">
&lt;style type="text/css"&gt;
.watermark{
	background:url(http://www.google.com/cse/intl/en/images/google_site_search_watermark.gif) no-repeat 5px 2px;
}
&lt;/style&gt;
</pre>
<p>HTML Code ตัวอย่าง</p>
<pre name="code" class="html:controls">
&lt;form id="form1" name="form1" method="post" action=""&gt;
  &lt;input name="kw" type="text" id="kw" size="45" /&gt;
  &lt;input type="submit" name="Sbt" id="Sbt" value="ค้นหา" /&gt;
&lt;/form&gt;
</pre>
<p>Javascript Code</p>
<pre name="code" class="javascript:controls">
&lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
google.load("jquery", "1.3.2");
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(function(){
	var objKey="#kw"; // id ของ ช่องค้นหา 
	if($(objKey).val()==""){
			$(objKey).addClass("watermark");
	}	
	$(objKey).focus(function(){	 
		$(objKey).removeClass("watermark");			 
	}).blur(function(){
		if($(objKey).val()==""){
			$(objKey).addClass("watermark");
		}	
	});	
});
&lt;/script&gt;
</pre>
]]></description><pubDate>Fri, 25 Dec 2009 03:29:01 +0700</pubDate></item><item><title>จัดรูปแบบ การแบ่งคอลัมน์ column ของ ตาราง สำหรับแสดงข้อมูล ด้วย  php </title><link>http://www.ninenik.com/จัดรูปแบบ_การแบ่งคอลัมน์_column_ของ_ตาราง_สำหรับแสดงข้อมูล_ด้วย__php_-248.html</link><description><![CDATA[<p>&nbsp;การนำข้อมูลมาแสดง โดยจัดรูปแบบ แบ่งเป็น column สามารถทำโดยการใช้ css จัดรูปแบบ หรือ การใช้ตาราง table</p>
<div>หากสามารถจัดรูปแบบ column โดยการใช้ css จะเป็นการดีมาก&nbsp;</div>
<div>&nbsp;</div>
<div><a href="http://www.ninenik.com/เทคนิค_CSS_แสดงข้อมูลแบ่งเป็น_คอลัมน์_แทนการใช้ตาราง_Table-229.html">http://www.ninenik.com/เทคนิค_CSS_แสดงข้อมูลแบ่งเป็น_คอลัมน์_แทนการใช้ตาราง_Table-229.html</a></div>
<div>&nbsp;</div>
<div>แต่หากต้องการความรวดเร็วสามารถใช้ในรูปแบบของตาราง table&nbsp;</div>
<div>ขั้นตอนการจัดคอลัมน์ ด้วยตาราง</div>
<div>&nbsp;</div>
<div><strong>1.กำหนดจำนวนคอลัมน์ที่ต้องการ ในที่นี้ใช้ 4 คอลัมน์</strong></div>
<div>&nbsp;</div>
<div><strong>2.สร้างตาราง 1 x 4 กำหนดความกว้างตาราง ตามต้องการ (1 แถว &nbsp;x 4 คอลัมน์)</strong></div>
<div>
<pre name="code" class="html:controls">
&lt;table width="500" border="0" cellspacing="2" cellpadding="0"&gt;
  &lt;tr&gt;
    &lt;td width="125"&gt;&nbsp;&lt;/td&gt;
    &lt;td width="125"&gt;&nbsp;&lt;/td&gt;
    &lt;td width="125"&gt;&nbsp;&lt;/td&gt;
    &lt;td width="125"&gt;&nbsp;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</pre>
</div>
<div><strong>3.แทรก php โค้ตดังตัวอย่างต่อไปนี้ (กรณีดึงจากฐานข้อมูล)</strong></div>
<div>
<pre name="code" class="php:controls">
&lt;table width="500" border="0" cellspacing="2" cellpadding="0"&gt;
&lt;?php
$i=1;
$q="SELECT * FROM table ";   
$qr=mysql_query($q);   
$numItem=mysql_num_rows($qr);
$numCol=4;
$remainCol=$numCol-($numItem%$numCol);
while($rs=mysql_fetch_array($qr)){  
?&gt;
&lt;?php if($i%$numCol==1){ ?&gt;
  &lt;tr&gt;
    &lt;td width="125"&gt;&lt;?=$rs['data']?&gt;&lt;/td&gt;
&lt;?php } ?&gt;
&lt;?php if($i%$numCol==2){ ?&gt;    
    &lt;td width="125"&gt;&lt;?=$rs['data']?&gt;&lt;/td&gt;
&lt;?php } ?&gt;
&lt;?php if($i%$numCol==3){ ?&gt;        
    &lt;td width="125"&gt;&lt;?=$rs['data']?&gt;&lt;/td&gt;
&lt;?php } ?&gt;
&lt;?php if($i%$numCol==0){ ?&gt;        
    &lt;td width="125"&gt;&lt;?=$rs['data']?&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;?php } ?&gt;
&lt;?php $i++; } ?&gt;
&lt;?=($remainCol&gt;0 && $remainCol!=$numCol)?"&lt;td colspan=".$remainCol."&gt;&lt;/td&gt;&lt;/tr&gt;":""?&gt;  
&lt;/table&gt;
</pre>
</div>
<div>
<pre name="code" class="php:controls">
//	คำอธิบาย
//	บรรทัดที่ 6 หาจำนวน รายการทั้งหมดที่แสดง
//	บรรทัดที่ 7 กำหนดจำนวนคอลัมน์ ตามจำนวนที่ต้องการแสดง
//	บรรทัดที่ 8 คำนวนหาจำนวนคอลัมน์ที่เหลือ กรณีข้อมูลแสดงไม่ครบทุกคอลัมน์ในแต่ละแถว
//	บรรทัดที่ 11 15 18 และ 21 เงื่อนไขสำหรับแสดงข้อมูลแต่ละ คอลัมน์ 
//	สังเกตว่า เงือนไขสำหรับคอลัมน์แรก  ใช้ &lt;?php if($i%$numCol==1){ ?&gt; เงื่อนไข $i%$numCol==1
//	และเงื่อนไขสำหรับคอลัมน์ต่อๆ ไปจะเป็น $i%$numCol==2 , $i%$numCol==3 ..... ไปเรื่อย ๆ 
//	จนถึง เงื่อนไขคอลัมน์สุดท้ายจะต้องกำหนดเป็น $i%$numCol==0 เสมอ
//	บรรทัดที่ 26 เงื่อนไขสำหรับกรณ๊ข้อมูลแสดงไม่ครบทุกคอลัมน์
</pre>
<div><strong>4.เมื่อสามารถแสดงคอลัมน์ข้อมูลได้แล้ว ก็ทำการจัดรูปแบบข้อมูลที่ต้องการแสดง ในแต่ละคอลัมน์ตามต้องการ</strong></div>
<div><strong>โดยอาจแทรกตารางเข้าไปในแต่ละคอลัมน์ เพื่อจัดรูปแบบก็ได้</strong></div>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></description><pubDate>Wed, 23 Dec 2009 00:00:00 +0700</pubDate></item><item><title>ใช้งาน fckeditor WYSIWYG editor สำหรับเว็บบอร์ด หรืออื่นๆ อย่างง่าย</title><link>http://www.ninenik.com/ใช้งาน_fckeditor_WYSIWYG_editor_สำหรับเว็บบอร์ด_หรืออื่นๆ_อย่างง่าย-247.html</link><description><![CDATA[<p>ดาวน์โหลด fckeditor <a href="http://www.ninenik.com/download/get-fckeditor.zip" target="_blank">คลิก</a>
</p>
<p>แตกไฟล์ get-fckeditor.zip ก็อบปี้ โฟลเดอร์ fckeditor ไปไว้บน server ที่ตำแหน่ง /public_html  หรือตำแหน่งอื่นๆ ตามต้องการ</p>
<p>
การปรับแต่งการแสดงหากต้องการเพิ่มเติม ให้แก้ไขในไฟล์ fckconfig.js<br>
ไฟล์ที่ดาวน์โหลด ปรับรูปแบบ toolbar เพิ่มมาให้ 2 รูปแบบ<br>
1.Default  ตัวต้นฉบับ<br>
2.Basic ตัวต้นฉบับ<br>
3.Normal <br>
4.None<br>
</p>
<p>การใช้งาน WYSIWYG editor เป็นการเพิ่มความสามารถให้ textarea เมื่อมีการใช้ WYSIWYG editor จึงเหมือนกับ
เป็นการใช้งาน textarea ทั่วไป ดังนั้นเมื่อเรากำหนดชื่อให้กับ WYSIWYG editor เป็น message เมื่ออยู่ในฟอร์ม และทำการส่ง
ค่า ข้อมูลที่รับจาก WYSIWYG editor ก็คือตัวแปร $_POST['message'] หรือ $_GET['message'] ตามแต่ว่าส่งเป็นแบบ GET หรือ POST</p>

<p>การใช้งาน</p>
<pre name="code" class="php:controls">
&lt;?php
include("fckeditor/fckeditor.php"); // เรียกใช้งานเพียงครั้งเดียว
$oFCKeditor = new FCKeditor('message') ; // กำหนดชื่อเป็น message หรืออื่นๆ ตามต้องการสำหรับเรียกใช้
$oFCKeditor-&gt;BasePath = "fckeditor/" ; // ตำแหน่งโฟลเดอร์ ของ fckeditor 
$oFCKeditor-&gt;Width= 800 ; // ความกว้าง
$oFCKeditor-&gt;Height= 200 ; // ความสูง
$oFCKeditor-&gt;ToolbarSet ="Normal"; // รูปแบบ Toolbar อาจเป็น Default , Basic , Normal , None หรือ อื่นๆ 
$oFCKeditor-&gt;Value ="" ; //
//$oFCKeditor-&gt;Value ="test" ; // กรณ๊กำหนดค่าเริ่มต้น หรือดึงข้อมูลจากฐานข้อมูล
$oFCKeditor-&gt;Create() ;
?&gt;
</pre>
<p>นำโค้ดด้านบนไปวางแทนที่ textarea ใน form ที่ต้องการ
กรณีใช้มากกว่า 1 อันในหนึ่งหน้า ตัวที่สองไม่ต้อง include ไฟล์ fckeditor/fckeditor.php อีก</p>]]></description><pubDate>Mon, 21 Dec 2009 06:02:26 +0700</pubDate></item><item><title>ประยุกต์การทำ overlay เพจ กับกล่องข้อความ ด้วย jQuery</title><link>http://www.ninenik.com/ประยุกต์การทำ_overlay_เพจ_กับกล่องข้อความ_ด้วย_jQuery-246.html</link><description><![CDATA[<input type="button" name="btAddOverlay" id="btAddOverlay" value="ตัวอย่างคลิก" />
<style type="text/css">
div.alertBox{
	border:5px solid #33CC00;
	background-color:#F5FEED;
	width:300px;
	margin:auto;
	height:75px;
	text-align:center;
	font-size:12px;
}
</style>
<script type="text/javascript">
$(function(){
	var OverlayObj="<div class='overlay'><div class='alertBox'></div></div>";
	$("#btAddOverlay").click(function(){
		$(document.body).prepend(OverlayObj);
		$("div.overlay").css({
				position:"absolute",  
				top:0,
				left: 0,   
				background:"#000",   
				width:"100%", 
				height:$(document).height(),   
				opacity:.7			
		});
		$("div.alertBox").animate({
			marginTop:150
		},500).html("<br>จัดรูปแบบกล่องข้อความ นี้ใน css class<br>Click to close");
		$("div.alertBox").bind('click',function(){
			$("div.overlay").fadeOut("fast");
		});		
	});
});
</script>
<p>css code สำหรับกล่องข้อความ จัดรูปแบบตามต้องการ</p>
<pre name="code" class="css:controls">
&lt;style type="text/css"&gt;
div.alertBox{
	border:5px solid #33CC00;
	background-color:#F5FEED;
	width:300px;
	margin:auto;
	height:75px;
	text-align:center;
	font-size:12px;
}
&lt;/style&gt;
</pre>
<p>HTML ปุ่ม สำหรับตัวอย่าง code</p>
<pre name="code" class="html:controls">
&lt;input type="button" name="btAddOverlay" id="btAddOverlay" value="ตัวอย่างคลิก" /&gt;
</pre>
<p>javascript code</p>
<pre name="code" class="javascript:controls">
&lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;     
&lt;script type="text/javascript"&gt;     
google.load("jquery", "1.3.2");     
&lt;/script&gt; 
&lt;script type="text/javascript"&gt;
$(function(){
	var OverlayObj="&lt;div class='overlay'&gt;&lt;div class='alertBox'&gt;&lt;/div&gt;&lt;/div&gt;";
	$("#btAddOverlay").click(function(){
		$(document.body).prepend(OverlayObj);
		$("div.overlay").css({
				position:"absolute",  
				top:0,
				left: 0,   
				background:"#000",   
				width:"100%", 
				height:$(document).height(),   
				opacity:.7			
		});
		$("div.alertBox").animate({
			marginTop:150
		},500).html("&lt;br&gt;จัดรูปแบบกล่องข้อความ นี้ใน css class&lt;br&gt;Click to close");
		$("div.alertBox").bind('click',function(){
			$("div.overlay").fadeOut("fast");
		});		
	});
});
&lt;/script&gt;
</pre>
<p>ตัวอย่างคลิก <a href="http://www.ninenik.com/demo/overlay-jquery.php">ตัวอย่าง</a></p>]]></description><pubDate>Sun, 20 Dec 2009 03:00:39 +0700</pubDate></item></channel></rss>