views:

97

answers:

1

First of all, here is the site I am working on.

I am trying to get a modal window to pop-up when elements in the Flash are clicked on. Which at this point I have about 90% working when you click on the warrior image. Below is a list of issues I am still trying to solve that I hope you can help me with...

  • The modal background doesn't fill up the whole page like it should.
  • I cannot get the close button to work
  • I need to set the vidname variable in both the Flash and Java to load in a dynamic HTML file. Depending on which image is clicked on. My naming convention will probably be something like vid-1.html, vid-2.html, etc.

If you need to look at the .js file you can view it at /cmsjs/jquery.ha.js

Below is the ActionScript I currently have...

var vidname = "modal.html";

peeps.vid1.onRelease = function() {

getURL('javascript:loadVid(\'' + vidname + '\');');

};

A: 

Well I have one for you.

Your current close code is

$('#modalBG, #modalClose').click(function(){
  closeModal();
});

If you click the background after a video loads you'll see that the modal does close. The reason your close button does not work is because #modalClose does not exist in the DOM when you are binding to the click function.

You need to either rebind the modalClose element when you modify the DOM or use live. If you use live you just need to change your click code to this:

$('#modalBG, #modalClose').live("click", (function(){
  closeModal();
});
Andy Gaskell