iosOverlay.js苹果手机操作提示

iosOverlay.js苹果手机操作提示

添加时间:2021-03-02 16:00:10
站长推荐丨赞助论坛,可获取海量资源终身免费下载权限奥!
举报 举报
收藏
预览
附件 附件
  • 模板类型模板类型:弹窗
  • 模板颜色模板颜色:中级
  • 下载积分下载积分:28 米粒
  • 下载权限下载权限:

    赞助会员

本文演示了IOS常用的四种不同的提示效果,兼容所有浏览器。
iosOverlay.js苹果手机操作提示
分类:悬浮层/弹出层 > 弹窗 难易:中级

HTML

<p class="container">
      <button id="loading" class="btn">Loading Spinner</button>
      <button id="checkMark" class="btn">Success</button>
      <button id="cross" class="btn">Error</button>
</p>

引入相关组件

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="css/iosOverlay.css">
<script src="js/jquery.min.js"></script>
<script src="js/iosOverlay.js"></script>
<script src="js/custom.js"></script>

Loading Spinner

$(document).on("click", "#loading",
function(e) {
    var opts = {
        lines: 13,
        // The number of lines to draw
        length: 11,
        // The length of each line
        width: 5,
        // The line thickness
        radius: 17,
        // The radius of the inner circle
        corners: 1,
        // Corner roundness (0..1)
        rotate: 0,
        // The rotation offset
        color: '#FFF',
        // #rgb or #rrggbb
        speed: 1,
        // Rounds per second
        trail: 60,
        // Afterglow percentage
        shadow: false,
        // Whether to render a shadow
        hwaccel: false,
        // Whether to use hardware acceleration
        className: 'spinner',
        // The CSS class to assign to the spinner
        zIndex: 2e9,
        // The z-index (defaults to 2000000000)
        top: 'auto',
        // Top position relative to parent in px
        left: 'auto' // Left position relative to parent in px
    };
    var target = document.createElement("div");
    document.body.appendChild(target);
    var spinner = new Spinner(opts).spin(target);
    iosOverlay({
        text: "Loading",
        duration: 2e3,
        spinner: spinner
    });
    return false;
});

Success

$(document).on("click", "#checkMark",
function(e) {
    iosOverlay({
        text: "Success!",
        duration: 2e3,
        icon: "img/check.png"
    });
    return false;
});

Error

$(document).on("click", "#cross",
function(e) {
    iosOverlay({
        text: "Error!",
        duration: 2e3,
        icon: "img/cross.png"
    });
    return false;
});

loadToSuccess

$(document).on("click", "#loadToSuccess",
function(e) {
    var opts = {
        lines: 13,
        // The number of lines to draw
        length: 11,
        // The length of each line
        width: 5,
        // The line thickness
        radius: 17,
        // The radius of the inner circle
        corners: 1,
        // Corner roundness (0..1)
        rotate: 0,
        // The rotation offset
        color: '#FFF',
        // #rgb or #rrggbb
        speed: 1,
        // Rounds per second
        trail: 60,
        // Afterglow percentage
        shadow: false,
        // Whether to render a shadow
        hwaccel: false,
        // Whether to use hardware acceleration
        className: 'spinner',
        // The CSS class to assign to the spinner
        zIndex: 2e9,
        // The z-index (defaults to 2000000000)
        top: 'auto',
        // Top position relative to parent in px
        left: 'auto' // Left position relative to parent in px
    };
    var target = document.createElement("div");
    document.body.appendChild(target);
    var spinner = new Spinner(opts).spin(target);
    var overlay = iosOverlay({
        text: "Loading",
        spinner: spinner
    });

    window.setTimeout(function() {
        overlay.update({
            icon: "img/check.png",
            text: "Success"
        });
    },
    3e3);

    window.setTimeout(function() {
        overlay.hide();
    },
    5e3);

    return false;
});

详细方法请下载压缩包,查看custom.js

iosOverlay.js相关API

参数 描述 默认值
onbeforeshow Function noop()
onshow Function noop()
onbeforehide Function noop()
onhide notification.hide(); noop()
update notification.update({ text: &amp;amp;quot;Success!&amp;amp;quot;, icon: &amp;amp;quot;img/smiley.png&amp;amp;quot; }); -
text 文字 -
icon 图标路径 -
spinner 引入Spin.js -
duration 延时效果 毫秒ms -
相关内容推荐
资源求助发帖
查看更多发帖

*

回帖描述:

*

链接类型:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
热点内容推荐
标题:iosOverlay.js苹果手机操作提示

*

描述:
平均回复时间:3-10分钟
规则介绍:悬赏寻求论坛网友分享资源,站点对分享内容的准确性,合法性,版权等没有足够的监管能力。如果您发现资源不正确,无法使用,不符合法律法律等情况,您可以直接举报资源。站长将尽快核实您的举报,并根据情况,采取封号,退换米粒等处理。

*

回帖描述:

*

链接类型:

*

阅读权限:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
  • 背景波浪
  • 背景波浪
  • 波浪
  • 波浪
客服
在线咨询
周一 至 周日 9:00 ~ 22:00
QQ:1326974360
微信:juyoubuluo6688
客服热线
18205485173
工作日 9:00 ~ 18:00
微信扫码咨询
客户服务
欢迎咨询服务
咨询量较多时,请耐心等待
社群

关注公众号

获取更多资讯

扫码进群(QQ)

与更多大牛交流沟通

0.258917s