Greasy Fork is available in English.

pops

一个由纯js编写的弹窗,编写缘由为替代本人的网盘链接识别脚本中的pop.js文件(该文件压缩过)。

Acest script nu ar trebui instalat direct. Aceasta este o bibliotecă pentru alte scripturi care este inclusă prin directiva meta a // @require https://greasyfork.org/scripts/456485-pops/code/pops.js?version=1134453

Autor
WhiteSevs
Versiune
0.0.1.20230103060048
Creat
12-12-2022
Actualizat
03-01-2023
Licență
N/A

自定义弹窗

pops.alert  /* 普通信息框 */
pops.confirm  /* 询问框 */
pops.prompt  /* 输入框 */
pops.loading  /* 加载层 */
pops.iframe  /* iframe层 */
pops.isPhone  /* 判断是否是手机访问 */
# 部分使用方法

pops.alert({
  closeEnable: false,
  mask: true,
  only: true,
});

pops.prompt({
  position: "center",
  closeEnable: true,
  mask: true,
  only: true,
  title: {
    text: "prompt",
    position: "center",
  },
  content: {
    placeholder: "提示",
    text: "自带的内容",
    row: false /* 多行 */,
    focus: true /* 输入框自动聚焦 */,
  },
  btn: {
    ok: {
      callback: (event) => {
        console.log(event);
        alert("确定");
        event.close();
      },
    },
  },
});

pops.loading({
  parent: document.body,
  only: true,
});

详情参数请看代码