移动端 一个简单易懂的弹出框

图片效果如下 淡入 淡出。自适应居中。

  

1
2
3
4
5
6
7
8
9
10
11
12
13
function tishi(content,url) {
        $(".xiaoxi").remove();
    var html = '<div class="xiaoxi none" id="msg" style="z-index:9999;left: 5%;width: 90%;position: fixed;background:none;top:50%;"> <p class="msg" style="background: none repeat scroll 0 0 #000; border-radius: 30px;color: #fff; margin: 0 auto;padding: 1.5em;text-align: center;width: 70%;opacity: 0.8;"></p></div>';
    $(document.body).append(html);
    $("#msg").show();
        $(".msg").html(content);
    if(url){
        window.setTimeout("location.href='"+url+"'", 1500);
    }else{
         setTimeout('$("#msg").fadeOut()', 1500);
    }
}   
tishi('留言成功');
posted @   一颗星—Broken  阅读(2617)  评论(1)    收藏  举报
编辑推荐:
· Hangfire Redis 实现秒级定时任务,使用 CQRS 实现动态执行代码
· Android编译时动态插入代码原理与实践
· 解锁.NET 9性能优化黑科技:从内存管理到Web性能的最全指南
· 通过一个DEMO理解MCP(模型上下文协议)的生命周期
· MySQL下200GB大表备份,利用传输表空间解决停服发版表备份问题
阅读排行:
· .NET周刊【4月第1期 2025-04-06】
· 国产的 Java Solon v3.2.0 发布(央企信创的优选)
· centos停服,迁移centos7.3系统到新搭建的openEuler
· 工良出品 | 长文讲解 MCP 和案例实战
· 多年后再做Web开发,AI帮大忙
点击右上角即可分享
微信分享提示