Question about loading a page into a layer
On click of a text link, I have a dealer registration form that appears in a site I am working on. To close the window, I have a close icon in the called page where the idea was that when the visitor clicks on the image, they will close the window. Below is the script I use to call the information:
- jQuery(document).ready(function(){
jQuery("#dealerInfoForm").click (function () {jQuery("#newsDisplay").load("pages/dealerApplication.php"); jQuery("#newsDisplay").toggle('normal');});
jQuery("#closeThatWindow").click (function () {jQuery("#newsDisplay").hide('slow');});
});
The reason I am using jQuery rather then $ is that on my WAMP test server, for some reason the shorthand version doesn't work, and on my live server works fine. So to keep it simple, I just include the original call to the script.
Inside the dealerApplication.php form, is a simple 'X' graphic to close the window, which I use the ID closeThatWindow. But it doesn't close the window. Any idea why? Below is the code for the image graphic in the external page that is loaded into the newsDisplay window:
- <a href="#" id="closeThatWindow"><img src="images/closeButton1.jpg" alt=" " width="40" height="40" align="right"></a>