zoukankan      html  css  js  c++  java
  • jquery 提示信息

    // 提示信息
    // 使用 ShowTip("请输入要搜索的处理机构!", 'info');
    function ShowTip(tip, type) {
        var $tip = $('#tip');
        if ($tip.length == 0) {
        // 设置样式,也可以定义在css文件中
            $tip = $('<span id="tip" style="transform:translate(-50%,-50%);position:fixed;top:50%;left: 50%;z-index:9999;height:28px; padding: 2px 16px;line-height: 28px;color:#fff;background:rgba(0,0,0,0.7);font-size:12px;border-radius:4px;"></span>');
            $('body').append($tip);
        }
        $tip.stop(true).prop('class', 'alert alert-' + type).text(tip).fadeIn(500).delay(1000).fadeOut(500);
    }
    
    // 正在加载中
    //loading.ShowLoading(); 显示   loading.CloseLoading();隐藏
    var loading={
        loadingHtml:'<div class="loading" style="display: flex;align-items: center; transform:translate(-50%,-50%);position:fixed;top:50%;left: 50%;z-index:9999;height:28px; padding: 2px 16px;line-height: 28px;color:#fff;background:rgba(0,0,0,0.7);font-size:12px;border-radius:4px;"><img style=" 14px;height: 14px;margin-right: 6px;" src="img/loading.gif" />正在加载中</div>',
        ShowLoading:function(){
            $('body').append(loading.loadingHtml);
        },
        CloseLoading:function(){
            $('body .loading').remove();
        }
    }
  • 相关阅读:
    第一章 数据集散地:数据库
    第六章 使用ADO.NET查询和操作数据
    第五章 使用ADO.NET访问数据库
    第四章 深入C#的String类
    IOS框架和服务
    一步步调试解决iOS内存泄漏
    app跳转
    iOS 视频直播
    学习心得
    iOS中FMDB的使用
  • 原文地址:https://www.cnblogs.com/yeziyou/p/13469463.html
Copyright © 2011-2022 走看看