zoukankan      html  css  js  c++  java
  • js 提示条

    js:

    var Persen = {
    timeUptopBar:function(fun)
    {
    var obj = $('.top-alert');
    obj.fadeOut(1500,function () {
    if(fun && typeof(fun) != 'undefined')
    {
    eval(fun);
    }
    });
    return false;
    },
    alertNavtopBar:function (msg, alerttype, fun)
    {
    if(typeof(fun) == 'undefined')
    {
    fun = '';
    }
    var obj = $('.top-alert');
    var btn = $('.top-alert button');
    obj.removeClass('alert-success alert-warning alert-danger');

    obj.addClass('alert-'+alerttype);
    $('#navbar-msg').html(msg);
    obj.fadeIn(1000);
    setTimeout(function(){
    Persen.timeUptopBar(fun);
    },3000);

    btn.click(function(){
    Persen.timeUptopBar(fun);
    });
    },

    html:

    <!-- 错误、成功提示 STA-->
    <div class="alert alert-dismissible navbar-fixed-top top-alert alert-success" role="alert" style="min-height: 50px; height: 50px; display: none; ">
    <div class="container">
    <button type="button" class="close"><span aria-hidden="true">×</span></button>
    <div id="navbar-msg" style="text-align: center"></div>
    </div>
    </div>

    引用举例:


    Persen.alertFail(msg);
    Persen.alertSuccess(msg);

    $('html,body').animate({scrollTop: '0px'}, 800); 滚动条滑动



  • 相关阅读:
    实验四 代码评审
    实验三、UML 建模工具的安装与使用
    结对编程 第二阶段
    结对编程第一阶段
    实验一 GIT代码版本管理
    实验五 单元测试
    实验四 代码评审
    实验三 UML 建模工具的安装与使用
    结对编程阶段二
    结对编程第一阶段
  • 原文地址:https://www.cnblogs.com/jasonxiaoqinde/p/7519417.html
Copyright © 2011-2022 走看看