G
G
GTAlex2020-03-18 14:03:39
JavaScript
GTAlex, 2020-03-18 14:03:39

Magnific Popup gallery - how to add your own button to the popup window?

There is a magnific Popup image gallery - everything is ok, scroll through and look ...

$('.image-popup').magnificPopup({
  type: 'image',
  gallery: {
     enabled: true
  }
})


It is necessary to add the "use this image" button to the popup form (with the possibility of further styling)
so that, when pressed, its own function is called, for example, displaying the name of the image file in the console.

How to implement?!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2020-03-18
@GTAlex

Use the markup property .

G
GTAlex, 2020-03-18
@GTAlex

Thank you! Exactly what is needed!
Function handler in callback on open and voila!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question