How do I bind a jQuery Tools overlay event to an existing overlay?

Posted by Paul on Stack Overflow See other posts from Stack Overflow or by Paul
Published on 2010-05-13T03:47:40Z Indexed on 2010/05/13 3:54 UTC
Read the original article Hit count: 310

Filed under:
|
|
|
|

Say when the page loads, this code runs:

jQuery(document).ready(function($){
  $('#overlay').overlay( api: true );
});


How would I bind an event to it? I've tried:

$('#overlay').onBeforeLoad( function(){ alert('Hi'); });

$('#overlay').bind( 'onBeforeLoad', function(){ alert('Hi'); });

var api = $('#overlay').data('overlay');
api.onBeforeLoad(function(){ alert('Hi') });


When I do:

alert(api.getContent().attr('id'));

An alert pops up with '#overlay' inside.


When the overlay is open and I run:

alert(api.isOpened());

An alert pops up with 'false' inside.


Thanks in advance.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about tools