使用canvas怎么實(shí)現(xiàn)一個(gè)手寫簽名效果

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)碛嘘P(guān)使用canvas怎么實(shí)現(xiàn)一個(gè)手寫簽名效果,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

創(chuàng)新互聯(lián)建站堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站制作、做網(wǎng)站、外貿(mào)營銷網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的肇慶網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

HTML代碼:

<!--手寫區(qū)-->
        <div class="mSign_signMark_box">
            <div class="mSign_signMark_write_box">
                <div id="mSign_signMark_signature_pad" class="mSign_signMark_body_box">
                    <div class="mSign_signMark_body">
                        <span  class="mSign_signMark_clear_out">
                            <img src="../images/mCommon_basicIcon_deleteRed.png">
                        </span>
                        <p>手寫區(qū)</p>
                        <canvas id="mSign_signMark_canvas"></canvas>
                    </div>
                </div>
            </div>
        </div>
        <!--手寫區(qū) end-->
        <!--底部按鈕-->
        <div class="mSign_signMark_footer">
            <span id="mSign_signMark_clear_out" class="mSign_signMark_footer_cancle">清除</span>
            <span id="mSign_signMark_submit" class="mSign_signMark_footer_sure">確定</span>
        </div>
        <!--底部按鈕 end-->

CSS樣式:

.mSign_signMark_box{padding: 15px 15px 26px 15px;}
.mSign_signMark_footer{max-width:640px;margin:0 auto;height: 44px;background: #4ba7eb;position: fixed;bottom: 0;left: 0;right: 0;color:#fff;font-size: 16px;text-align: center;line-height: 44px;}
.mSign_signMark_footer span{display: block;width: 50%;text-align: center;float: left;}
.mSign_signMark_footer_cancle{background: #f4f4f5;color: #333333;}
/*手寫簽名*/
.mSign_signMark_write_box{position: relative;height: 240px;}
.mSign_signMark_body_box {position: absolute;background-color: #fff;border: 1px solid #ccc;top:0;left: 0;right: 0;bottom: 0;width: 99%;height: auto;min-width: 250px;min-height: 140px;}
.mSign_signMark_body {position: absolute;left: 0;right: 0;top: 0;bottom: 0;}
.mSign_signMark_body canvas {position: absolute;left: 0;top: 0;width: 100%;height: 100%;}
.mSign_signMark_body p{position: absolute;font-size: 14px;color: #ccc;text-align: center;width: 100%;top: 50%;margin-top: -22px;}
.mSign_signMark_clear_out{position: absolute;top:-10px;right: -5px;z-index: 10;display: none;}
.mSign_signMark_clear_out img{width: 18px;height: 18px;}

頁面引入JS:

//手寫區(qū)觸摸事件
$(function() {
    var ctouch=$('.mSign_signMark_body canvas');
    ctouch.bind("touchstart",function(event){
        $('.mSign_signMark_body p').hide();
    });
    ctouch.mouseover(function(event) {
        $('.mSign_signMark_body p').hide();
    });
});

上述就是小編為大家分享的使用canvas怎么實(shí)現(xiàn)一個(gè)手寫簽名效果了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

當(dāng)前標(biāo)題:使用canvas怎么實(shí)現(xiàn)一個(gè)手寫簽名效果
文章轉(zhuǎn)載:http://muchs.cn/article42/jchdhc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、服務(wù)器托管、全網(wǎng)營銷推廣、微信小程序、電子商務(wù)外貿(mào)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計(jì)