今天我向大家推薦的這款 jQuery 驗證碼,不僅僅 WordPress 可用,折騰折騰只要需要驗證碼的地方都可以安放。比如 WordPress 這樣使用:
1、下載:jQuery.buttonCaptcha;
2、儲存 jquery.buttonCaptcha.js,jquery.buttonCaptcha.styles.css 和 'images' 檔案夾到 WordPress 主題某一路徑下。記住,所有關於 buttonCaptcha 檔案必須儲存在同一目錄,如果沒有那麼你就需要編輯 .css 檔案;
3、將下面代碼放到 <body> 裡面:
/*如果沒有 jQuery 檔案請自行到官網下載*/
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-ui-1.8.12.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/js/buttonCaptcha/jquery.buttonCaptcha.styles.css" />
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/buttonCaptcha/jquery.buttonCaptcha.min.js"></script>
/*具體設定顯示參數可以參考 jquery.buttonCaptcha.js 檔案*/
<script type="text/javascript">
$(function(){
$("#submit").buttonCaptcha({//#submit請修改為你評論提交按鈕的ID
codeWord:'H',
codeZone:'aozer',
captchaHeader:'你是 Robot 嗎?// Are you a robot?',
captchaTip:'拖動左邊的字母到右邊,直到出現 "%code_word%"。謝謝!<br>Drag letters from left to right, to get word "H". Thanks!',
captchaUnlocked:'已解鎖!// Unlocked!'
});
});
</script>
就這樣,具體示範就看文章後面評論下面的驗證碼吧,再改改還可以用到其它地方哦!