<html>
<head>
    <title>举报按钮</title>
    <style>
        .report-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 80px;
            height: 40px;
            background-color: #f00;
            color: #fff;
            text-align: center;
            line-height: 40px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class='report-btn' onclick='openReportPage()'>举报</div>
<pre><code>&lt;script&gt;
    function openReportPage() {
        // 使用模态框弹出举报内容
        var reportModal = document.createElement('div');
        reportModal.innerHTML = '&lt;h1&gt;举报内容&lt;/h1&gt;'; // 这里可以添加你的举报表单或其他内容
        reportModal.style.position = 'fixed';
        reportModal.style.top = '0';
        reportModal.style.left = '0';
        reportModal.style.width = '100%';
        reportModal.style.height = '100%';
        reportModal.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
        reportModal.style.display = 'flex';
        reportModal.style.justifyContent = 'center';
        reportModal.style.alignItems = 'center';
        document.body.appendChild(reportModal);
    }
&lt;/script&gt;
</code></pre>
</body>
</html>
网站举报按钮代码 - 如何在页面添加举报功能

原文地址: https://www.cveoy.top/t/topic/Ib9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录