关闭jQuery弹出窗口

Close jQuery Popup

本文关键字:窗口 jQuery 关闭      更新时间:2023-09-26

我有一个网站,是用一些脚本从codelifter.com这是一个非常古老的网站,我需要做一个小编辑。我没有创建网站,我只是想知道为什么JavaScript弹出不会关闭。如果你点击CA,你很快就会得到一个到来,但如果你点击TX,它会打开一个不会关闭的弹出窗口。

我的问题是我需要改变哪一行代码才能关闭?

下面的代码有问题吗?

感谢
var strGoToUrl = "";
        function ShowPopup(strUrl) {
            var str = '<table cellspacing="1" cellpadding="2" style="background:black"><tr>';
            str += '<td style="background:#ffeccc" width="460">';
            str += '<table cellspacing="0" cellpadding="2" width="100%"><tr>';
            str += '<td align="right"><a href="javascript:HidePopup();">Close</a></td>';
            str += '</tr><tr>';
            str += '<td align="center">';
            str += 'TODAY- ASA members can get medical insurance quotes and buy quality, affordable ';
            str += 'medical insurance group plans through Benefit Consultants Northwest (BCNW).<br/><br/>';
            str += '<a href='"' + strUrl + ''">Click here for Quotes, Medical plan information and plan selections.</a><br/>';
            str += '<a href='"' + strUrl + ''"><img src="images/bcnw_logo3.gif" width="186" height="60" border="0" /></a><br/>';
            str += 'Automotive Industry Health Insurance Trust (A-HIT) association medical plans ';
            str += 'are not currently available in this state.<br/><br/>';
            str += '</td></tr></table></td></tr></table>';
            strGoToUrl = strUrl;
            alert(strGoToUrl);
            if (document.getElementById) {
                var elem = document.getElementById("popupDiv");
                elem.innerHTML = str;
                elem.style.display = "block";
                ShowRectangularDynamicDropShadow(elem, "#333333", 5);
            }
        }
        function GoToUrl() {
            alert(strGoToUrl);
            window.location = strGoToUrl;
        }
        function HidePopup() {
            if (document.getElementById) {
                var elem = document.getElementById("popupDiv");
                HideRectangularDynamicDropShadow(elem);
                elem.style.display = "none";
                elem.innerhtml = "";
            }
        }

试试这个…没有测试,但应该可以工作…

<div id="popupDiv">
//Rest of the code
<div id="shadow"></div>
</div>
function ShowPopup(strUrl) {
        //rest of the code
          shadowDiv = document.getElementById("shadow").style.display = 'block';
          ShowRectangularDynamicDropShadow(shadowDiv, "#333333", 5);
        //rest of the code
}
   function HidePopup() {
        if (document.getElementById) {
            var elem = document.getElementById("popupDiv");
            shadowDiv = document.getElementById("shadow");
            HideRectangularDynamicDropShadow(shadowDiv);
            elem.style.display = "none";
            shadowDiv.style.display = "none";
            elem.innerhtml = "";
        }
    }