Answer the question
In order to leave comments, you need to log in
How to animate magnificPopup modal on page load?
The magnificPopup documentation has examples of animations when a modal is invoked. But nowhere can I find an example of how to make an animation (for example, zoom) of the appearance of a window when the page loads. Found on the forums a few remotely resembling examples, but does not work. Help me please! Here is the preparation:
$.magnificPopup.open({
items: {
src: '#form',
type: 'inline'
},
closeBtnInside: true
});
Answer the question
In order to leave comments, you need to log in
Hang an event on page load, for example, like this:
<script>
function ready() {
$.magnificPopup.open({
items: {
src: '#form',
type: 'inline'
},
closeBtnInside: true
});
}
I'll explain in more detail. There are examples of animations https://codepen.io/dimsemenov/pen/GAIkt
But here the window is called: $('#inline-popups').magnificPopup and inside the animation, but you need without the click event $.magnificPopup.open
And now if I For this example, I try to hang the animation, it does not work for some reason. Apparently the methods need to be specified differently?
the whole trick is in the class on which css animations are hung:
you can customize them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question