Adding content to dynamic fancybox

 $.post('ajax.php', { callback: 'send_mail', name: $("#name").val() },
            function(data){
                if(data.request == 'success'){
                            $.fancybox(data.name);  


                }else{

                    alert('error');

                }
            }, 'json');

here is my ajax call in my fancybox, and although it works, it is fancybox by default. This original fantasy has the following options.

$('#login_page').fancybox({ 
        'scrolling'     : 'no',
        'overlayOpacity': 0.1,
        'showCloseButton'   : false

    }); 

My question is how to place the return value inside the fantasy field and set the parameters?

EDIT:

ah, i figured it out. There is an extended option for content:

+3
source share
1 answer

There is an option called content that allows you to enter html.

"content" : "<p>sfsdfsdf</p>",
+7
source

Source: https://habr.com/ru/post/1793944/


All Articles