Answer the question
In order to leave comments, you need to log in
How to call a fancybox modal via a function?
Greetings to all-all-all in this castle. Guys, there is such a design
edit: function(id, news_id, type){
$.post(dle_root + 'engine/ajax/controller.php?mod=user_upload', {id:id, news_id:news_id, action:'edit', url:type}, function(response){
if( response == 'not' ) alert('Файла нету');
else if(response == 'not_owner') alert('Файл вам не принадлежит');
else{
$("body").append("<div id='trueModalEditFile' style='display:none'>"+response+" <button data-fancybox-close class='btn'>Close me</button></div>");
}
});
},
<a data-fancybox="" data-src="#trueModalEditFile" data-modal="true" href="#" onclick="uFiles.edit('0', '0', '0'); return false;" class="btn" title="Редактировать">линк</a>
$("body").append
Answer the question
In order to leave comments, you need to log in
This is
$('body').append("<div id='edit-file-alert' title='Редактировать' style='display:none'>"+response+"</div>");
$.fancybox.open(response)
$.fancybox.open("#edit-file-alert")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question