R
R
rootiys2014-02-22 20:12:24
fancyBox
rootiys, 2014-02-22 20:12:24

How to close fancybox window on button click?

Greetings!
The site has a modal window in which data is filled in by users. When you click on Send, the data is sent to the mail.
How can I make the modal window close when I click the Submit button?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Alexander Khirenko, 2014-02-22
@Satanpit

$(document).on('submit', '#your-form', function() {
    $.fn.fancybox.close();
});

A
Alexander Khirenko, 2014-02-22
@Satanpit

Or for a button

$(document).on('click', '#your-button', function() {
    $.fn.fancybox.close();
});

L
LB777, 2014-11-24
@LB777

At me responsible for closing
Everything that needs to be hung on event.

R
Roman, 2018-05-10
@RGBPlus

<a href="javascript:;" onclick="$.fancybox.close();" class="close">Закрыть</a>

C
cubania, 2019-02-01
@cubania

<div class="close">Закрыть</div>

$('.close').click(function () {
  $.fancybox.close();
});

I
I.CaR Soft, 2016-04-14
@I_CaR

<a href="sample.php" target="_top">закрыть</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question