Answer the question
In order to leave comments, you need to log in
FancyBox 3 how to pass data from button to form?
Good afternoon.
I am slowly switching to fancyBox 3, and I run into difficulties, I ask for the help of those who know.
It is necessary to transfer data from the button to the form, before doing this:
// Ссылка
<a href="#form" class="link" data="Информация">link</a>
// Вызов JS
$(".link").fancybox({
'afterLoad': function() {
id = $(this.element).attr('data');
$("#tip").val(id);
}
});
// В самой форме
<p id="tip"></p>
<a href="javascript:;" data-fancybox data-src="#forma" data="Информация">link</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question