jQuery插件-busy-loadloading遮罩层插件

busy-load是一款灵活的jquery loading遮罩层插件。它可以在加载的时候为容器添加一个遮罩层,并显示loading效果。loader可以是字体图标,图片,文字等,非常灵活方便。

使用方法

在页面中引入jquery和busy-load相关文件。

<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/busy-load/dist/app.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/busy-load/dist/app.min.js"></script>
初始化插件

然后你就可以在需要的容器上调用loadingi效果了。

// 显示loading
$("#some-element").busyLoad("show");

或者在调用时带上配置参数。

// 带配置参数
$("#another-element").busyLoad("show", {
  background: "#000",
  spinner: "cube",
  animation: "slide"
});

如果需要隐藏loading,只需要传入"hide"即可。

// 隐藏loading
$("#some-element").busyLoad("hide");
// 带配置参数
$("#another-element").busyLoad("hide", {
  animation: "fade"
});

配置参数

buzy-load插件的默认配置参数如下:

exports.default = {
    spinner: "pump", // pump, accordion, pulsar, cube, cubes, circle-line, circles, cube-grid
    image: false,
    fontawesome: false, // "fa fa-refresh fa-spin fa-2x fa-fw"
    custom: false, // jQuery Object
    color: "#fff",
    background: "rgba(0, 0, 0, 0.21)",
    maxSize: "50px", // Integer/String only for spinners & images, not fontawesome & custom
    minSize: "20px", // Integer/String only for spinners & images, not fontawesome & custom
    text: false,
    textColor: false, // default is color
    textMargin: ".5rem",
    textPosition: "right", // left, right, top, bottom 
    fontSize: "1rem",
    fullScreen: false,
    animation: false, // fade, slide
    animationDuration: "fast", // String, Integer
    containerClass: "busy-load-container",
    containerItemClass: "busy-load-container-item",
    spinnerClass: "busy-load-spinner",
    textClass: "busy-load-text"
};               

busy-load jquery loading遮罩层插件的github网址为:https://github.com/piccard21/busy-load

在线预览 网盘下载

郑重声明:

1 本资源来源于互联网,资源的版权归资源原作者所持有,受《中华人民共和国著作权法》等相关法律保护。

2 由于无法和原作者取得联系,所以上传的部分资源无法先通过原作者的同意就分享给大家了,如本资源侵犯了您(原作者)的权益,请联系我们(微信号 xiaohaimei1989),我们会立马删除您的资源,并向您表达诚挚的歉意!

3 本站是一个公益型网站,分享资源的目的在于传播知识,分享知识,收取一点点打赏的辛苦费是用于网站的日常运营开支,并非用于商业用途。

4 本站资源只提供学习和参考研究使用,使用过后请在第一时间内删除。本站不承担资源被单位或个人商用带来的法律责任。

发表评论