zoukankan      html  css  js  c++  java
  • jQuery插件之模仿QQ邮箱的聊天功能的弹出弹出效果

    $.fn.extend({
        SetBigInSmallOut: function(ContextDiv, T, W, H, closeControlID) {
            return this.each(function(i) {
                $(this).bind("click", function(event) {
                    var btnOffset = $(event.target).offset();
                    if ($("#" + ContextDiv).css("display") == "none") {
                        $("#" + ContextDiv).css({ 'top': btnOffset.top, 'left': btnOffset.left, 'width': '0', 'height': '0' }).animate(
                                    {
                                        height: H,
                                        width: W,
                                        left: (document.documentElement.clientWidth - W) / 2,
                                        top: T
                                    }, "slow", function() {
                                        this.style.display = "";
                                        $(this).attr({ "hideTop": btnOffset.top, "hideLeft": btnOffset.left });
     
                                        $("#" + closeControlID).css({ "cursor": "pointer" }).unbind();
                                        $("#" + closeControlID).click(function(event) {
                                            //alert($("#div_").attr("hideLeft"));
                                            $("#" + ContextDiv).animate(
                                        {
                                            height: 0,
                                            width: 0,
                                            left: $("#" + ContextDiv).attr("hideLeft"),
                                            top: $("#" + ContextDiv).attr("hideTop")
                                        }, "slow", function() {
                                            this.style.display = "none";
                                        });
                                        });
                                    }
                            );
     
                    }
                });
            });
        }
    });
     
    //$("input").SetBigInSmallOut("div_", 300, 300, 200, "close"); 主div,距离顶部多少px,主div高度,主div宽度,关闭主div的按钮id
  • 相关阅读:
    用 Go 实现一个 LRU cache
    【转】入行软件测试,零基础拿OFFER
    【转】IntelliJ idea 高效使用教程,一劳永逸!
    python连接Oracle报错DPI1047
    【转】Pycharm快捷键设置(鼠标滚动控制字体大小)
    【转】Ubuntu:命令行安装可视化界面
    【转】Windows 如何在cmd命令行中查看、修改、删除与添加环境变量
    VAR多变量预测
    windows进程管理
    git关闭filemode
  • 原文地址:https://www.cnblogs.com/jianjialin/p/1597954.html
Copyright © 2011-2022 走看看