Last active
February 7, 2018 10:31
-
-
Save andrei99/c1c6fd8a99b470023b059b7a9d1e37c9 to your computer and use it in GitHub Desktop.
Magnific popup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//html | |
<a href="#" class="call_back">Call me</a> | |
<div id="callback" class="item_popup mfp-hide"> | |
<p class="name_item_popup">name popup</p> | |
</div> | |
//js | |
$('body').on('click', 'a.call_back', function () { | |
$.magnificPopup.open({ | |
items: { | |
src: '#callback', | |
type: 'inline', | |
removalDelay: 300, | |
preloader: false | |
}, | |
mainClass: 'mfp-fade' | |
}); | |
return false; | |
}); | |
//fade effect sass | |
.mfp-fade | |
&.mfp-bg | |
opacity: 0 | |
transition: all 0.15s ease-out | |
&.mfp-ready | |
opacity: 0.8 | |
&.mfp-removing | |
opacity: 0 | |
&.mfp-wrap | |
.mfp-content | |
opacity: 0 | |
transition: all 0.15s ease-out | |
&.mfp-ready .mfp-content | |
opacity: 1 | |
&.mfp-removing .mfp-content | |
opacity: 0 | |
//item sass | |
.item_popup | |
max-width: 500px | |
background: #fff | |
box-shadow: 0px 5px 20px 0px rgba(0, 0, 0, 0.4) | |
padding: 40px 30px 40px | |
margin: 0 auto | |
position: relative |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment