Re: [jQuery] Event Model Madness

2006-09-04 Thread Chris Ovenden
On 9/1/06, Kelvin Luck [EMAIL PROTECTED] wrote:
 Michael Haggerty wrote:
  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.

 This isn't an answer to your question but a suggestion for a workaround.
 If you embed the flash with wmode=transparent then it doesn't always
 like to be on top and your thickbox should work fine. The downside is
 that the performance of the flash movie will suffer - depends on the
 movie but this may be an easier solution,

You can avoid the performance hit by using wmode=opaque instead of
wmode=transparent. But be warned, both of these are slightly buggy -
in particular check that any clickable areas are still where you
expect them to be after scrolling the page in firefox 1.x

-- 
Chris Ovenden

http://thepeer.blogspot.com
Imagine all the people / Sharing all the world

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Event Model Madness

2006-09-01 Thread Michael Haggerty
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/


Re: [jQuery] Event Model Madness

2006-09-01 Thread John Resig
Well, one thing that can help is that the click events only need to be
bound once:

$(document).ready(function(){
  $('a.thickbox').click(function(){
 $('#mp3player').hide(); return false;
  });

  
$('#TB_closeAjaxWindow,#TB_closeWindowButton,#TB_ImageOff,#TB_overlay').click(function(){
 $('#mp3player').show(); return false;
  });
});

With all that said, however, looking at the thickbox demo page
(http://jquery.com/demo/thickbox/) he lists your exact question in the
FAQ - pointing to this page as the solution:
http://www.communitymx.com/content/article.cfm?cid=E5141

Hope that helps!

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/