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 🙏

© 2024 – Pkg Stats / Ryan Hefner

k-layer

v0.1.2

Published

a popup layer components

Downloads

1

Readme

k-layer

layer弹窗的代替插件,不依赖jquery

使用方法:

message提醒:

klayer.msg(/* 提醒内容 */, /* 提醒存在时间,单位ms,默认1000 */);

open弹窗:

klayer.open({
  title: '提醒',                         //标题内容,默认“提醒”
  content: DOM || 'hello world!',       //提醒内容,支持直接挂载DOM元素
  btn: ['btn1', 'btn2', 'btn3'],        //按钮内容,数组形式可以添加多个按钮
  hideClose: true,                      //是否隐藏关闭按钮,默认false
  hideShadow: true,                     //是否隐藏遮罩层,默认false
  skin: 'error',                        //添加自定义class名
  direct: 'l',                          //弹窗出现位置:可选值有 l、t、b、r、lt、lb、rt、rb
  success: function(id, dom) {},        //打开成功后的回调
  btn1: function(id, dom) {             //按钮的回调,接收参数为“弹窗编号”(可以用于js关闭弹窗)和弹窗DOM元素
    console.log('btn1', id, dom);
  },
  btn2: function(id, dom) {             //第二个按钮的回调,其余按钮的回调依次递增btn后的数字
    console.log('btn2', id, dom);
  },
  btn3: function(id, dom) {
    klayer.close(id);                   //关闭某一个弹窗
  }.bind(this),
  close: function(id, dom) {},          //关闭按钮的回调
  end: function(id, dom) {}             //弹窗被摧毁后的回调
});

loading加载:

var load = klayer.load();               //返还加载层id

close关闭:

klayer.load(klayerID);                  //指定要关闭的id

closeAll关闭所有弹窗:

klayer.closeAll();                      //关闭所有弹出层