Dmitriy Kupriyanov
Dmitriy Kupriyanov

Reputation: 479

How to get a callback in fancyBox

I want to get a callback in fancyBox when I use the open function:

$.fancybox.open($("#some_block"));
// or
$.fancybox.open("my text");

How can I get a callback after the show block?

Upvotes: 1

Views: 227

Answers (1)

Viktor Kukurba
Viktor Kukurba

Reputation: 1370

You can try to use afterShow handler. http://jsfiddle.net/nt7x48yr/1/

$.fancybox.open($("#some_block"), {
  afterShow: function() {alert('afterShow');}   
});
// or
$.fancybox.open("my text", {
  afterShow: function() {alert('afterShow');}   
});

Upvotes: 3

Related Questions