npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

free-mask-dialog

v1.0.5

Published

It's a free dialog with mask for pc client

Readme

It is a free dialog with full screen mask

How use ?

 const maskDialog = require('free-mask-dialog');
 let mask = new maskDialog({
     title:'This is title',
     content:'This is content',
 })

API function

show ()


show the dialog

eq:mask.show()

hide ()


hide the dialog

eq:mask.hide()

showBefore(cb)


call the cb function before show the dialog

hideAfter(cb)


call the cb function after hide the dialog

other option


closeBtnEle [String | Array]


you can add the classname to emit close action

bg [Boolean]


you can control the mask-bg show or hide

title [String]


set the title for the dialog

content [String]


set the content for the dialog

z-index [Number]


set the class of the z-index for the dialog. when you setted the param —— z-index with the dialog will change the mask-bg's z-index

width [Number|String]


set the dialog width support the percentage

height [Number|String]


set the dialog height support the percentage

closeBtn [Boolean]


set the closeBtn show or hide

closeBtnEle [String]


control and add the element's class with this parameter in the close button

scroll [Boolean]


set the webpack cann't scroll. The defaults value is true

canClose [Boolean]


if the value is true will emit dialog hide function when click the mask-bg

style [String]


add the className for the mask_dialog_main. you can use it do anything. such as change the class with the dialog. the default value is default

autoInitContent [Boolean]


auto refresh the dialog setting before emit show function.The default value is true. If the param value is false will jump over the render function

btn [Array]


just only support Array

  • content : the btn text
  • url : the btn link
  • cb : the btn click function
  • target : open link method

such as:

let mask = new maskDialog({
  title: "This is title",
  content: "This is content",
  btn: [
    {
      content: "btn 1",
      cb: () => {
        alert(2);
      }
    },
    {
      content: "btn 2",
      target: "_blank",
      url: "https://www.google.com"
    }
  ]
});

中文文档

let mask = new maskDialog({
    'closeBtnEle':'.mask_dialog_close' //默认.mask_dialog_close [optional]
    'bg': Boolean //[optional]
    'title':String  
    'content':String  
    'z-index': Number //层级(number),设置的是 bg 的层级,联动会设置弹窗 [optional]
    'width': 200, //宽度:可传递各种单位,默认 100%
    'height': 300, //高度:可传递各种单位
    'closeBtn':Boolean, //关闭按钮,false 不显示  [optional]
    'scroll': Boolean //页面滚动:false 为不可滚动,默认为 true 可滚动 [optional]
    'canClose':Boolean //点击关闭:false 为不可以点击关闭,默认为 true 可点击关闭 [optional]
    'style': String //'类名,控制修改 class=mask_dialog_main 的 同级类,默认是 default,可以由此来控制对话框样式', [optional]
    'autoInitContent':false, //每次 show 都会重新,默认为 true,不启动传 false [optional]
});

mask.show(); // 显示提示框,传显示内容,一般为 STRING——DOM
mask.hide(); // 隐藏提示框
mask.showBefore(){}; //显示回调
mask.hideAfter(){}; //隐藏回调