2013-03-18 8 views
0

J'ai un Site qui a été construit avec quelques scripts de codelifter.com c'est un très vieux site et j'ai besoin de faire une petite modification. Je n'ai pas créé le site je me demande juste pourquoi le popup de Javascript ne fermera pas. Si vous cliquez sur CA, vous obtenez un produit bientôt, mais si vous cliquez sur TX, cela ouvre une fenêtre qui ne se fermera pas.Fermer jQuery Popup

Ma question est de savoir quelle ligne de code dois-je changer pour la fermer?

Le problème avec le code ci-dessous?

Merci

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

Le site fonctionne très bien dans Firefox. Dans quels navigateurs voyez-vous ce comportement? En outre, avez-vous fait un débogage pour voir si vous obtenez des erreurs? Je suppose que vous n'avez pas. à la ligne 256 de maploacation.aspx vous obtenez des erreurs: document.Show.MouseX.value = tempX; –

+2

J'ai observé dans Chrome. Il y a un tas d'erreurs que vous pouvez observer dans la console. Donc, vous devez d'abord corriger ces erreurs pour que la fonction s'exécute. (Rapide hack) Au lieu d'essayer de rendre l'affichage nul, essayez de supprimer ce nœud. – theshadowmonkey

Répondre

0

Essayez ceci ... Non testé, mais devrait fonctionner ...

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