`; newWindow.document.write(iframeContent); newWindow.document.close(); } }); // 关闭按钮事件(仅在手机端使用) $(document).on('click', '#pdf-close-btn', function () { $('#pdf-overlay').hide(); $('#pdf-iframe').attr('src', ''); // 清空 iframe,节省资源 }); }); // 创建并显示全屏 PDF 查看层(仅用于手机端) function showPdfOverlay(viewerUrl) { // 如果 overlay 还不存在,则创建 if ($('#pdf-overlay').length === 0) { $('body').append(` `); } // 设置 iframe 地址并显示 $('#pdf-iframe').attr('src', viewerUrl); $('#pdf-overlay').show(); }