zoukankan      html  css  js  c++  java
  • canvas--手写板

    HTML代码:
    
    <!--手写区-->
            <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>手写区</p>
                            <canvas id="mSign_signMark_canvas"></canvas>
                        </div>
                    </div>
                </div>
            </div>
            <!--手写区 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-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; 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; 99%;height: auto;min- 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; 100%;height: 100%;}
    .mSign_signMark_body p{position: absolute;font-size: 14px;color: #ccc;text-align: center; 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{ 18px;height: 18px;}
    
    页面引入JS:
    
    //手写区触摸事件
    $(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();
        });
    });
    
    手写签名引入js文件:
    
    链接:http://pan.baidu.com/s/1miP3sFm
    密码:8x7q
  • 相关阅读:
    配置JAVA环境
    Sun Java认证
    JAVA中去掉空格
    2011年百度新闻热搜榜十大互联网人物
    23 设计模式
    HTML编辑器FCKeditor使用详解 [转]
    Linux 系统目录结构
    DotNet程序员是不是最不幸福?
    VS2005(c#)项目调试问题解决方案集锦 转
    详细介绍有关于.NET的委托
  • 原文地址:https://www.cnblogs.com/jentary/p/12619074.html
Copyright © 2011-2022 走看看