非常實用的 jQuery驗證碼

來源:互聯網
上載者:User

今天我向大家推薦的這款 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>
 
就這樣,具體示範就看文章後面評論下面的驗證碼吧,再改改還可以用到其它地方哦!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.