码迷,mamicode.com
首页 > 其他好文 > 详细

weui 弹出层

时间:2018-07-03 20:00:43      阅读:816      评论:0      收藏:0      [点我收藏+]

标签:llb   href   java   fast   display   app   dialog   out   html   

function dialog(title, msg, callback) {
        dialog2 = ‘        <div class="weui_dialog_alert" id="dialog2" style="display: none;">            <div class="weui_mask"></div>           <div class="weui_dialog">            <div class="weui_dialog_hd"><strong class="weui_dialog_title">‘ + title + ‘</strong></div>            <div class="weui_dialog_bd">‘ + msg + ‘</div>            <div class="weui_dialog_ft">             <a href="javascript:;" class="weui_btn_dialog primary">确定</a>            </div>           </div>          </div>         ‘;
        if (!$(‘#dialog2‘).length) {
            $(‘body‘).append(dialog2);
        } else {
            $(‘#dialog2 .weui_dialog_title‘).html(title);
            $(‘#dialog2 .weui_dialog_bd‘).html(msg);
        }
        $(‘#dialog2‘).fadeIn(‘fast‘);
        $(‘#dialog2 .primary‘).on(‘click‘, function () {
            $(‘#dialog2‘).fadeOut(‘fast‘);
            var url = callback;
            if (url !== ‘‘) {
                window.location.href = url;
            }
        });

    }

  

weui 弹出层

标签:llb   href   java   fast   display   app   dialog   out   html   

原文地址:https://www.cnblogs.com/wlyxr/p/9260059.html

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