jquery支持手机端手写签名签字保存效果代码

代码语言:html

所属分类:其他

代码描述:jquery支持手机端手写签名签字保存效果代码,可一个字一个字地签。

代码标签: jquery 签名 签字 手机端

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>

<head>
   
<meta charset="utf-8">
   
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
   html
,
body
{
       
/* 重置默认样式 */
       
margin: 0;
       
padding: 0;
       
background: #eee;
       
font-size: 18px;
}

html
,
body
,
#mycanvas {
       
width: 100%;
       
height: 100%;
       
overflow: hidden;
       
background: #FFF;
}

.name-block {
       
width: 30px;
       
background: #FFF;
       
height: 30px;
       
display: inline-block;
}

.btn-name {
       
width: 50px;
       
height: 50px;
}

#test2 {
       
width: 100%;
       
overflow: hidden;
       
margin-top: 10px;
       
text-align: center;
}

.btns {
       
margin: 0 auto;
       
text-align: center;
       
margin-top: 20px;
}

.canvas-sign {
       
background-color: #2E2E2E;
       
position: fixed;
       
top: 0;
       
left: 0;
       
right: 0;
       
bottom: 0;
       
display: none;
       
z-index: 20;
}

* {
       
touch-action: pan-y;
}

#canvas {
       
margin: 0 auto;
}

#controller {
       
position: relative;
       
clear: both;
}

#clear_btn {
       
/*float: right;
                                                                                                  */

       
display: inline-block;
       
margin-right: 0;
}

.colorList {
       
clear: both;

}

.img-block {
       
display: none;
}

#signPeo {
       
line-height: 30px;
       
height: 30px;
       
width: 48px;
       
background: #00aaff;
       
border-radius: 4px;
       
font-size: 16px;
       
color: #fff;
       
text-align: center;
       
margin-right: 3px;
}

.btns button {
       
border-radius: 4px !important;
       
box-sizing: border-box;
       
padding: 10px 20px;
       
/* outline: navajowhite; */
       
border: 0;
       
font-size: 18px;
}

#images {
       
background-color: #2E2E2E;
       
position: fixed;
       
top: 0;
       
left: 0;
       
right: 0;
       
bottom: 0;
       
display: none;
       
z-index: 30;
}

#images-copy {
       
position: absolute;
       
top: 30%;
       
bottom: 35%;
       
left: 10%;
       
right: 10%;
       
background: #fff;
       
border-radius: 6px;
       
box-sizing: border-box;
       
padding: 10px;
}

.next-imgs {
       
display: flex;
       
justify-content: center;
}

</style>
</head>

<body>
   
<div style="text-align: center;
                       
display: flex;
                       
justify-content: center;
                       
align-items: center; ">
       
<p id="signPeo" class="initBlok">签名</p>
       
<p style="line-height:30px" class="initBlok"></p>
       
<div id="next-img" style="display: flex;
                                       
justify-content: center;">
           
<img class="name-block " id="canvas0"></img>
       
</div>
   
</div>
   
<div class="canvas-sign">
       
<div style="text-align: center; ">
           
<p style="color:#FFFFFF">请逐字手签:</p>
           
<div class="next-img">
               
<img class="name-block btn-name" id="ca0"></img>
           
</div>
       
</div>
       
<div id="test2">
           
<p style="color:#FFFFFF">签字区域:</p>
           
<div id="mycanvas">
               
<canvas id="canvas"></canvas>
           
</div>
       
</div>
       
<div class="btns">
           
<!-- <button type="button" id="clear" onclick="reset()">重写</button> -->
           
<button id="clear_btn" onclick="reset()" class="op_btn">清 除</button>
           
<div class="next-t" style="display: inline-block;margin:0 10px">

           
</div>
           
<button type="button" id="comp">保存</button>
       
</div>
   
</div>
   
<div id="images">
       
<div id="images-copy">
           
<p>确认以下签名字数是否完整,若不是则点击取消后,补全后再次保存</p>
           
<div class="next-imgs">

           
</div>
           
<div class="btns">
               
<button type="button" style="color: #fff;background: #333333;margin-right:5px" id="cancel">取消</button>
                <button type="button" style="color: #fff;bac.........完整代码请登录后点击上方下载按钮下载查看

网友评论0