<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "jQuery圖形動態鍵盤使用範例"]]></title>
		<link>https://forum.andowson.com/posts/list/5.page</link>
		<description><![CDATA[Latest messages posted in the topic "jQuery圖形動態鍵盤使用範例"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>jQuery圖形動態鍵盤使用範例</title>
				<description><![CDATA[ 下面介紹jQuery Keypad的使用 (網站：http://keith-wood.name/keypad.html)，範例畫面如附件圖1 
<br>
<br>
【範例】 
<br>
Step 1：至http://keith-wood.name/keypad.html下載整包套件，主要使用到的檔案有以下幾個： 
<br>
[code]jquery.plugin.js 
<br>
jquery.keypad.js 
<br>
jquery.keypad.alt.css 
<br>
keypad.png[/code] 
<br>
<br>
Step2：編輯html，新增二個文字輸入方塊，帳號及密碼 
<br>
[code]&lt;!DOCTYPE html&gt; 
<br>
&lt;html&gt; 
<br>
&lt;body&gt; 
<br>
&lt;p&gt;&lt;input type="text" id="accKeypad"&gt;&lt;/p&gt; 
<br>
&lt;p&gt;&lt;input type="password" id="pwdKeypad"&gt;&lt;/p&gt; 
<br>
&lt;/body&gt; 
<br>
&lt;/html&gt;[/code] 
<br>
<br>
Step 3：將jquery.keypad.alt.css、jquery.plugin.js、jquery.keypad.js加入至html中，另外需加入google api提供的jquery.min.js。(PS.如果網站為https，則需將google api網址也改為https) 
<br>
[code]&lt;link rel="stylesheet" href="jquery.keypad.alt.css"&gt; 
<br>
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt; 
<br>
&lt;script src="jquery.plugin.js"&gt;&lt;/script&gt; 
<br>
&lt;script src="jquery.keypad.js"&gt;&lt;/script&gt;[/code] 
<br>
<br>
Step 4：在html中編輯javascript 
<br>
[code]&lt;script&gt; 
<br>
$(function () { 
<br>
 $('#accKeypad,#pwdKeypad').keypad({keypadOnly: false, 
<br>
 randomiseOther: true, randomiseNumeric: true, randomiseAlphabetic: true, randomiseOther: true, 
<br>
 showOn: 'button', buttonImageOnly: true, buttonImage: 'keypad.png', showAnim: '', 
<br>
 layout: $.keypad.qwertyLayout}); 
<br>
}); 
<br>
&lt;/script&gt;[/code] 
<br>
註1：如果想要使每次鍵盤上的文字位置不同，除上述方式外(randomiseOther: true, randomiseNumeric: true, randomiseAlphabetic: true, randomiseOther: true)，也可改用 randomiseAll: true，但數字鍵就不會固定在右方區塊。 
<br>
註2：「showOn: 'button', buttonImageOnly: true, buttonImage: 'keypad.png'」：點選鍵盤圖示才顯示動態鍵盤，若想改為當游標出現在輸入框時也顯示，則改成「showOn: 'both', buttonImage: 'keypad.png'」。 
<br>
註3：「showAnim: ''」：指鍵盤顯示時不使用特效。 
<br>
<br>
<br>
Step 5：如想更換鍵盤外觀，可使用google api提供的主題，先加入以下css，以smoothness為例 
<br>
[code]&lt;link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css"&gt;[/code] 
<br>
<br>
其他主題可參考jQuery keypad網站之Styling頁籤中，「ThemeRoller styling:」的地方，將上面css網址改為其他名稱即可，例如欲改為blitzer，則修改成下面的路徑： 
<br>
[code]http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/blitzer/jquery-ui.css[/code] 
<br>
<br>
 再加入以下參數至.keypad()中，結果如附件圖2 
<br>
[code]useThemeRoller: true[/code] 
<br>
<br>
完整html如下： 
<br>
[code]&lt;!DOCTYPE html&gt; 
<br>
&lt;html&gt; 
<br>
&lt;head&gt; 
<br>
&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt; 
<br>
&lt;title&gt;jQuery Keypad&lt;/title&gt; 
<br>
&lt;link rel="stylesheet" href="jquery.keypad.alt.css"&gt; 
<br>
&lt;link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css"&gt; 
<br>
<br>
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt; 
<br>
&lt;script src="jquery.plugin.js"&gt;&lt;/script&gt; 
<br>
&lt;script src="jquery.keypad.js"&gt;&lt;/script&gt; 
<br>
&lt;script&gt; 
<br>
$(function () { 
<br>
 $('#accKeypad,#pwdKeypad').keypad({useThemeRoller: true, keypadOnly: false, 
<br>
 randomiseOther: true, randomiseNumeric: true, randomiseAlphabetic: true, randomiseOther: true, 
<br>
 showOn: 'button', buttonImageOnly: true, buttonImage: 'keypad.png', showAnim: '', 
<br>
 layout: $.keypad.qwertyLayout}); 
<br>
}); 
<br>
&lt;/script&gt; 
<br>
&lt;/head&gt; 
<br>
&lt;body&gt; 
<br>
&lt;p&gt;&lt;input type="text" id="accKeypad"&gt;&lt;/p&gt; 
<br>
&lt;p&gt;&lt;input type="password" id="pwdKeypad"&gt;&lt;/p&gt; 
<br>
&lt;/body&gt; 
<br>
&lt;/html&gt;[/code] 
<br>
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/642/1341.page</guid>
				<link>https://forum.andowson.com/posts/preList/642/1341.page</link>
				<pubDate><![CDATA[Wed, 14 Sep 2016 16:12:22]]> GMT</pubDate>
				<author><![CDATA[ bious3927]]></author>
			</item>
	</channel>
</rss>