ajax弹窗消息空间

var ClassAjaxOpenwin = function() {
    this.staticFlage = false;
    this.divId = "";
    this.ajaxUrl = "";
    this.setStaticFlage = function() {
        //document.writeln("setStateicFlage");
        this.staticFlage = true;
    }
    this.getAll = function(id, flag, kuan, thisObject, divid, action, searchType) {
        var self = this;
        $.ajax({
            type: "POST",
            url: "/ajax/ajaxHotels.aspx",
            data: "id=" + id + "&flag=" + flag + "&action=" + action + "&searchType=" + searchType,
            success: function(msg) {
                self.winOpenStr(msg, divid, flag);
            }
        });
        this.winOpen(kuan, thisObject, divid);
    }
    this.divHinden = function() {
        this.staticFlage = false;
        window.Obj = this;
        var t = setTimeout("Obj.divHinden2()", 500);
    }
    this.divHinden2 = function() {
        var thisDiv = document.getElementById("winpop");
        if (this.staticFlage == false) {
            thisDiv.innerHTML = "";
            thisDiv.style.display = "none";
        }
    }
    this.winOpen = function(kuan, thisObject, divid) {
        var pos = this.getPos(thisObject);
        var thisDiv = document.getElementById(divid);
        var theKuan = kuan * 80;

        thisDiv.style.width = theKuan + "px";
        thisDiv.style.left = pos.x + "px";
        thisDiv.style.top = (pos.y + 10) + "px";
        //alert(thisDiv.style.width);
    }
    this.winOpenStr = function(data, divid, flag) {
        var thisDiv = document.getElementById(divid);
        var htmlStr = "<ul>";
        var listStr = new Array();
        listStr = data.split(",");
        for (var i = 0; i < listStr.length; i++) {
            htmlStr = htmlStr + "<li><a href='?action=" + flag + "&searchFlag=2&searchType=" + listStr[i] + "'>" + listStr[i] + "</a></li>";

        }
        htmlStr = htmlStr + "</ul>";
        thisDiv.innerHTML = htmlStr;
        thisDiv.style.display = "";
    }
    this.getPos = function(o) //取元素坐标
    {
        var x = 0, y = 0;
        do {
            x += o.offsetLeft;
            y += o.offsetTop;
        } while (o = o.offsetParent);
        return { 'x': x, 'y': y };
    }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值