其他分享
首页 > 其他分享> > 响应PC端软件最小化、最大化、关闭和拖拽

响应PC端软件最小化、最大化、关闭和拖拽

作者:互联网

1.在页面中写入

				<h6 class="setting_header_title cmd_move" style="position: relative;">
                        聊天记录
                        <div style="width: 140px;position: absolute;right: 0;top: 0;height: 46px;">
                            <a style="display: block;width: 24px;height: 24px;cursor: pointer;margin-top: 8px;float: left;margin-left: 3px;"
                                class="cmd_min">
                                <img src="./img/zuixiaohua.png" style="width: 100%;height: 100%;" />
                            </a>
                            <a style="display: block;width: 24px;height: 24px;cursor: pointer;margin-top: 8px;float: left;margin-left: 13px;"
                                class="cmd_max">
                                <img src="./img/zuidahua.png" style="width: 100%;height: 100%;" />
                            </a>
                            <a style="display: block;width: 22px;height: 22px;cursor: pointer;margin-top: 8px;float: left;margin-left: 13px;"
                                class="cmd_close">
                                <img src="./img/guanbi.png" style="width: 100%;height: 100%;" />
                            </a>
                        </div>
                    </h6>

2.相应C端事件触发

$('.cmd_min').click(function (e) {
        e.stopPropagation();
        console.log('min')
        window.mbQuery(0x123456, '{"cmd":"min"}')
    })
    $('.cmd_max').click(function (e) {
        e.stopPropagation();
        console.log('max')
        window.mbQuery(0x123456, '{"cmd":"max"}')
    })
    $('.cmd_close').click(function (e) {
        e.stopPropagation();
        console.log('close')
        window.mbQuery(0x123456, '{"cmd":"close"}')
    })
    $('.cmd_move').mousedown(function (e) {
        e.stopPropagation();
        console.log('move')
        window.mbQuery(0x123456, '{"cmd":"move"}')
    })

标签:mbQuery,console,log,cmd,0x123456,stopPropagation,PC,最小化,拖拽
来源: https://blog.csdn.net/Teamig/article/details/111320968