$("body").on("click", ".mochu-bill-page-but", function () { if ($("#mochu_bill_img_src_dl").length > 0) { $("#mochu_bill").css("display", "block"); return false; } var html = '
正在生成中,L?..
'; $('body').append(html); var id = $(this).attr("data-id"); $.ajax({ url: bloghost + "zb_users/plugin/mochu_bill/ajax.php", type: "POST", data: {"id": id, "type": "html" }, dataType: "json", success: function (res) { $("#mochu_bill_Centent").html(res.html); } ,error: function () { alert("h生成p|"); $("#mochu_bill").css("display", "none");} }) }); window.downloadImg = function(id) { var img = document.getElementById('mochu_bill_img_src_dl'); var url = img.src; var a = document.createElement('a'); var event = new MouseEvent('click'); a.download = id; a.href = url; // a.initEvent('click',false,false); // document.dispatchEvent(a); a.dispatchEvent(event); } $("body").on("click","#mochu_bill_close",function(){ $("#mochu_bill").css("display", "none");});
  • www.hhrrr.com