Skip to content

Instantly share code, notes, and snippets.

@andrei99
Last active February 7, 2018 10:31
Show Gist options
  • Save andrei99/c1c6fd8a99b470023b059b7a9d1e37c9 to your computer and use it in GitHub Desktop.
Save andrei99/c1c6fd8a99b470023b059b7a9d1e37c9 to your computer and use it in GitHub Desktop.
Magnific popup
//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