友链提交
请认真填写以下信息,谢谢!
(贵站展示本站链接的页面地址,一般是友链页面,填写后将自动验证友链关系有效性)
(用于抓取文章)
(用于接收通知)
菜单
本页目录

悬浮按钮设置

提示

如果提交框展示形式选择弹窗形式时,需要配置触发弹窗的按钮,打开弹窗的方法是:openOverlay(),如果自定义按钮时,注意给按钮添加事件onclick="openOverlay()",需要选择悬浮按钮挂载页面,全局页面或者指定页面。插件提供了默认的按钮配置。

默认按钮代码
<style>
  .linksSubmit-fab-container {
    position: fixed;
    bottom: 320px;
    right: 20px;
    z-index: 999999;
  }
  .linksSubmit-fab {
    width: 56px;
    height: 56px;
    background-color: var(--background-color);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
  }
  .linksSubmit-fab:hover {
    background-color: var(--background-color);
  }
</style>
<div class="linksSubmit-fab-container">
  <button class="linksSubmit-fab" onclick="openOverlay()">申请友链</button>
</div>
<script>
  function toggleDisplayBasedOnA() {
    const a = document.querySelector(".linksSubmit-overlay");
    const b = document.querySelector(".linksSubmit-fab-container");

    if (window.getComputedStyle(a).display === "none") {
      b.style.display = "block";
    } else {
      b.style.display = "none";
    }
  }
  const observer = new MutationObserver(() => {
    toggleDisplayBasedOnA();
  });
  const aElement = document.querySelector(".linksSubmit-overlay");
  observer.observe(aElement, {
    attributes: true,
    attributeFilter: ["style"],
  });
  toggleDisplayBasedOnA();
</script>