码迷,mamicode.com
首页 > 移动开发 > 详细

移动端自定义错误提示

时间:2016-11-01 19:21:29      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:css   tip   out   class   rem   top   timeout   image   gif   

//错误提示
function alertWrap(Tiptext) {
    var oHtml = ‘<div id="errTip"><span>‘ + Tiptext + ‘</span></div>‘;
    $("#errTip").css({
        ‘top‘: ‘0%‘,
        ‘opacity‘: ‘0‘,
        ‘z-index‘:‘999‘
    });
    $("body").append(oHtml);
    setTimeout(function() {
        $("#errTip").css({
            ‘top‘: ‘50%‘,
            ‘opacity‘: ‘1‘,
            ‘z-index‘:‘999‘
        });
    }, 10)
    setTimeout(function() {
        $(‘#errTip‘).css({
            ‘top‘: ‘0%‘,
            ‘opacity‘: ‘0‘,
            ‘z-index‘:‘-1‘
        });
        setTimeout(function() {
            $("#errTip").remove();
        }, 500);
    }, 2000)
}

技术分享

移动端自定义错误提示

标签:css   tip   out   class   rem   top   timeout   image   gif   

原文地址:http://www.cnblogs.com/q460021417/p/6020446.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!