兼容ios苹果与andriod安卓手机端的canvas手写签名js代码

代码语言:html

所属分类:其他

代码描述:兼容ios苹果与andriod安卓手机端的canvas手写签名js代码

代码标签: andriod 安卓 手机 canvas 手写 签名 js

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>

    <style>
        #canvas {
            background: white;
            height: 300px;
            width: 300px;
        }
    </style>
</head>
<body>
    <canvas id="canvas">

    </canvas>
    <input type="button" class="but1" value="重新签名" />
    <input type="button" class="but2" value="提交签名" />
    <img id="sigimg" src="" />
    <script>
        var canvas = document.getElementById("canvas");
        //动态设置宽高
        canvas.width = 400;
        canvas.height = 300;

        var content = canvas.getContext("2d");
        //设置画笔的样式
        content.strokeStyle = "#000";
        content.lineWidth = 1;
        content.lineCap = 'round';
        content.lineJoin = 'round';
        content.shadowBlur = 1;
        content.shadowColor = '#000';

        content.beginPath();
        //点击
        canvas.addEven.........完整代码请登录后点击上方下载按钮下载查看

网友评论0