2013-03-18 107 views
0

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

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

下面的代码是否存在问题?

感谢

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 = ""; 
      } 
     } 
+0

该网站的工作只是罚款的Firefox。你在哪些浏览器中看到这种行为?另外,你有没有做过任何调试,看看你是否得到错误?我的猜测是你没有。在maploacation.aspx的第256行出现错误:document.Show.MouseX.value = tempX; – 2013-03-18 17:59:30

+2

我在Chrome中观察过。在控制台中可以观察到一堆错误。所以,你需要先纠正那些要执行的函数。 (快速入侵)不要尝试使显示无效,请尝试删除该节点。 – theshadowmonkey 2013-03-18 18:04:54

回答

0

试试这个...不测试,但应该工作...

<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 = ""; 
     } 
    }