Duke
Duke

Reputation: 36970

Fancybox: What is the best way to trigger fancybox iframe from another function

I would like to launch fancybox from another function. I need this trigger after some ajax function get success.

Code Base

$.post('principals/search_post/'+value, function(data) {

   **// I need to call fancybox here**

});

EDIT

I have a url like http://example.com/somepage. I need to open this in an iframe with fancybox after that ajax function.

Upvotes: 0

Views: 2221

Answers (2)

Janis
Janis

Reputation: 8769

You can open fancybox manually:

$.fancybox.open({
    href: 'your_url',
    type: 'iframe'
});

Upvotes: 6

Charlie Wu
Charlie Wu

Reputation: 7757

do you mean

$.post('principals/search_post/'+value, function(data) {
    $("a.images").fancybox();
});

Upvotes: 0

Related Questions