實現js調用彈窗

來源:互聯網
上載者:User

實現js調用彈窗

//Html代碼:點擊控制項實現調用“收件者彈窗”            <script src="') ?>"></script>                           
 
收件者:

【對應的user.js】

$(function(){    /* 彈出層選使用者 */    $('.user-group').on('click','.user-add',function (){        div = $(this).parent('div.user-group');        box = $(this).next('div.user-gather');        single = (typeof(div.attr('data-multi'))=='undefined');        window.top.art.dialog.open('base/user/index/dialog?single='+ (single),{//此處調用對應的dialog頁面樣式            title:'選擇' + (single?'一':'多') +'位同事',            width:480,            height:440,              lock:true,                      ok: function () {                users = this.iframe.contentWindow.$(".active");                users.each(function(i,dom){                    id = $(dom).attr('data-uid');                    if (div.find('div[data-uid='+id+']').length){                        window.top.art.dialog.tips('請不要重複添加');                        return;                    }                     input = '';                    $(dom).append(input);                    if (single){                        box.html(dom.outerHTML);                    }else{                        box.append(dom.outerHTML);                    }                    window.top.art.dialog.tips('已添加');                });                                if (!single) return false;            },            cancel: true        });    });    /* 使用者刪除 */    $('.user-group').on('click','.user-event',function (){        if (confirm('您確定刪除這個使用者嗎')){            $(this).remove();        }    });    /* 使用者還原 */    $('.user-group').each(function (i){            var _this = this;        var _data =$(_this).attr('data');        var _edit = $(_this).attr('data-form');        if(_edit) $(_this).append('

點擊選擇'); $(_this).append(''); if (_data && _data!=0){ $.each(_data.split(','), function(i,id){ if (!id) return; $.getJSON(window.top.site_url + 'base/user/query?id='+id,function (json){ if (!json) return; var _html = ''; if(_edit) _html +=''; _html += '

'+json.realname; _html +=''; $(_this).find('.user-gather').append(_html); }); }); } });});

【對應的dialog頁面】

                    <script>            $(function(){                $('.user-item').on('click',function (){                input->get('single') == 'true'): ?>                $(this).siblings().removeClass('active');                            $(this).toggleClass('active');        }) ;    });        </script>                                                                            id ?>" data-name="http://blog.csdn.net/u011781769/article/details/name ?>">

photo ? $user->photo : config_item('unfound_photo') ?>">

http://blog.csdn.net/u011781769/article/details/name ?> 全選 反選

【效果預覽】


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.