我正在使用 JSignature 并试图弄清楚如何在签名获得焦点和失去焦点时触发事件。
绑定到更改事件有效,但焦点、鼠标按下等不会触发。
如果有人知道如何执行此操作,将不胜感激
$('.jsig').jSignature({format:"image/jpeg"}) // inits the jSignature widget.
$(".jsig").jSignature.bind('mousedown', function(e) {
alert("mousedown");
});
$(".jsig").jSignature.bind('focus', function(e) {
alert("focus");
});
var j=$(".jsig").jSignature;
$(".jsig").bind('change', function(e) {
var d = $(e.target).jSignature("getData", "native");
document.getElementById('st').value=d.length+'.'+d[0].x.length;
});