Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for the user on any device.
Class | Description |
---|---|
Plugin Name: | Magnific Popup |
Author: | Dmitry Semenov |
License: | MIT licensed |
Website: | http://dimsemenov.com/ |
Git Branch: | dimsemenov/Magnific/ |
Dependencies: |
<link href="vendor/plugins/magnific/magnific-popup.css" rel="stylesheet" type="text/css" >
<script src="vendor/plugins/magnific/jquery.magnific-popup.js"></script>
Popup initialization code should be executed after document ready, for example:
$(document).ready(function() {
$('.image-link').magnificPopup({type:'image'});
});
The simplest way to initilize a Magnific Popup
<a class="magnific-link btn btn-primary" href="path-to-image.jpg">Open popup</a>
$('.magnific-link').magnificPopup({
type: 'image'
// other options
// gallery:{enabled:true}
});
Note: This method does not enable gallery mode, each item will be opened as a single popup
<div class="magnific-container">
<a class="btn btn-primary" href="assets/img/stock/1.jpg">Open popup 1</a>
<a class="btn btn-primary" href="assets/img/stock/2.jpg">Open popup 2</a>
<a class="btn btn-primary" href="assets/img/stock/3.jpg">Open popup 3</a>
</div>
$('.magnific-container').magnificPopup({
delegate: 'a', // child items selector, by clicking on it popup will open
type: 'image'
// other options
});
Note: This method does not enable gallery mode, each item will be opened as a single popup
<div class="magnific-gallery">
<a href="../../assets/img/stock/1.jpg" title=""><img src="../../assets/img/stock/1.jpg" width="131" height="87"></a>
<a href="../../assets/img/stock/2.jpg" title=""><img src="../../assets/img/stock/2.jpg" width="131" height="87"></a>
<a href="../../assets/img/stock/3.jpg" title=""><img src="../../assets/img/stock/3.jpg" width="131" height="87"></a>
</div>
$('.magnific-gallery').magnificPopup({
delegate: 'a', // child items selector, by clicking on it popup will open
type: 'image',
gallery:{enabled:true}
});
The items
option defines data for the popup item(s) and makes Magnific Popup ignore all attributes on the target DOM element. The value for items
can be a single object or an array of objects.
// Example with single object
$('.magnific-item').magnificPopup({
items: {
src: 'path-to-image-1.jpg'
},
type: 'image' // this is default type
});
To create such type of popup, first of define the path to the file that you wish to display and select ajax type of the popup.
// Example with single object
$('.magnific-item').magnificPopup({
items: {
src: 'path-to-image-1.jpg'
},
type: 'image' // this is default type
});
We can add a custom animation to the modal popup by modifying how a modal is created. Several modifications are required to a popups HTML and Javascript initilization.
$('.magnific-animate').magnificPopup({
items: { // Set item source
src: '../../assets/img/stock/1.jpg'
},
type: 'image', // set source type (image default)
removalDelay: 500, // delay removal by X to allow out-animation,
callbacks: {
beforeOpen: function(e) {
// Set Magnific Animation
var Animation = "mfp-rotateUp";
this.st.mainClass = Animation;
// Inform content container there is an animation
this.contentContainer.addClass('mfp-with-anim');
},
}
});
// Animations classes available:
// mfp-flipInY, mfp-flipInX
// mfp-zoomIn, mfp-zoomOut
// mfp-rotateUp, mfp-rotateDown, mfp-rotateLeft, mfp-rotateRight
// mfp-slideUp, mfp-slideDown, mfp-slideLeft, mfp-slideRight
// mfp-sign, mfp-newspaper
// mfp-fullscale, mfp-with-fade
For more detailed documentation you should refer to the plugins original documentation. Several additional resources have been listed below which contain further useful information.
Class | Description |
---|---|
Documentation: | http://dimsemenov.com/docs |
Advanced Examples: | http://codepen.io/collection/nLcqo/ |
Bootbox.js is a small JavaScript library which allows you to create programmatic dialog boxes using Bootstrap modals
Class | Description |
---|---|
Plugin Name: | Bootbox |
Author: | Nick Payne |
License: | MIT licensed |
Website: | http://bootboxjs.com/ |
Git Branch: | makeusabrew/bootbox |
Dependencies: |
None Required
Considered Core - <script src="assets/js/utility/utility.js"></script>
The simplest way to initilize a Bootstrap dialog Popup
<button id="some-button" class="btn btn-primary">Open popup</button>
$('#some-button').on('click',function() {
bootbox.alert("Hello world!", function() {
// do something
});
});
<button id="some-button" class="btn btn-primary">Open popup</button>
$('#some-button').on('click',function() {
bootbox.confirm("Are you sure?", function() {
// do something
});
});
For more detailed documentation you should refer to the plugins original documentation. Several additional resources have been listed below which contain further useful information.
Class | Description |
---|---|
Documentation: | http://bootboxjs.com/documentation.html |
More Examples: | http://bootboxjs.com/ |
JavaScript notifications for Bootstrap, jQuery UI, and the Web Notifications Draft.
Class | Description |
---|---|
Plugin Name: | PNotify |
Author: | Sciactive |
License: | MIT licensed |
Website: | http://sciactive.github.io/pnotify/ |
Git Branch: | sciactive/pnotify |
Dependencies: |
None Required
<script src="vendor/plugins/pnotify/pnotify.custom.js"></script>
The simplest way to initilize a PNotify dialog
<button id="pnotify-demo" class="btn btn-primary">Example</button>
$('#pnotify-demo').on('click',function() {
bootbox.alert("Hello world!", function() {
// do something
});
});
<button id="pnotify-demo" class="btn btn-primary">Example</button>
$('#pnotify-demo').on('click', function() {
new PNotify({
title: 'Regular Notice',
text: 'Check me out! I\'m a notice.',
type: 'info' // all contextuals available(info,system,warning,etc)
});
});
<button id="pnotify-demo" class="btn btn-primary">Example</button>
$('#pnotify-demo').on('click', function() {
var myStack = {"dir1":"down", "dir2":"right", "push":"top"}; // define new stack properties
new PNotify({
title: "Over Here",
text: "Check me out. I'm in a different stack.",
addclass: "stack-custom",
stack: myStack
})
});
For more detailed documentation you should refer to the plugins original documentation. Several additional resources have been listed below which contain further useful information.
Class | Description |
---|---|
Documentation: | http://sciactive.com/pnotify/ |
More Examples: | http://sciactive.com/pnotify/#demos-simple |