I am getting stuck with a tricky event sequence and am wondering if someone
can help. And pardon me if I seem like a n00b, I am more a drupal guy than
an AJAX person.
The site I am working on is here: http://dev.trellon.org/phmf/node/242
Here's what I am trying to do. Off to the left, there is a Flash audio
player and Thickbox on the same page. When a user clicks on an image, it
expands to cover the page in a gray background and display the photo in a
frame. Since Flash likes to always appear on top, I have come up with a
method to hide the player tied to the firing of Thickbox. Works like so:
$('a.thickbox').click(function(){
$('#mp3player').hide(); make_player(); return false;
});
I have also written a function to make the Flash audio player reappear when
Thickbox closes. It comes after this description. The trouble is, it does
not attach itself to the objects it is supposed to be attaching to. Nothing
happens when the code runs as is. When I insert an alert into the
a.thickbox.click function, tho, it works.
I wonder what I am doing wrong. It's like there needs to be some delay in
adding these events to get it to run. Does anyone have any experience with
this? Code follows.
M
$(document).ready(function(){
$('a.thickbox').click(function(){
$('#mp3player').hide(); make_player(); return false;
});
function make_player(){
$('#TB_closeAjaxWindow').click(function(){
$('#mp3player').show(); return false;
});
$('#TB_closeWindowButton').click(function(){
$('#mp3player').show(); return false;
});
$('#TB_ImageOff').click(function(){
$('#mp3player').show(); return false;
});
$('#TB_overlay').click(function(){
$('#mp3player').show(); return false;
});
$('#TB_closeWindowButton').click(function(){
$('#mp3player').show(); return false;
});
}
}
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/