$("#savebtn").on({ touchstart: function (e) { // 长按事件触发 timeoutevent = settimeout(function () { timeoutevent = 0; save(); }, 400); //长按400毫秒 // e.preventdefault(); }, touchmove: function () { cleartimeout(timeoutevent); timeoutevent = 0; }, touchend: function () { cleartimeout(timeoutevent); if (timeoutevent != 0) { } return false; } }) function save() {
$.ajax({ url: '****', type: 'post', data: { typecode: typecode }, contenttype: 'application/json', success: function (data) { var a = $("<a></a>").attr("href", "data:image/png;base64," + data.data.image).attr("download", "***.png").appendto("body"); a[0].click(); a.remove(); } }); }
如对本文有疑问, 点击进行留言回复!!
offset、client、scroll (width,height、left,top、X,Y)
网友评论