我已经在我的网站上实现了 touch-punch 插件,但我仍然无法将触控功能用于我的签名功能。当我在 Edge 上使用它时,触摸功能可能会在停止之前工作一秒钟。此外,对于普通的 Internet Explorer 来说,它工作得很好,但 Chrome 和 Firefox 根本无法使用触摸打孔。
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>
<link href="<?php echo plugins_url(); ?>/booking/css/jquery.signature.css" rel="stylesheet">
<script src="<?php echo plugins_url(); ?>/booking/js/jquery.signature.js"></script>
<script src='https://javascriptbase64.googlecode.com/files/base64.js' type='text/javascript'></script>
<script src="jquery.ui.touch-punch.min.js"></script>
签名代码:
<script>
$(function() {
$('#sig'+"<?php echo $row->bookingid; ?>").signature({
guideline: true,
guidelineOffset: 25,
guidelineIndent: 20,
guidelineColor: '#ff0000',
change: function(event, ui) {
var jsonval = $(this).signature('toJSON');
$("#signcanvas"+"<?php echo $row->bookingid; ?>").val(jsonval);
}
});
});
</script>