npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

m-popup

v1.0.10

Published

jQuery modal dialog plugin. Can display inline HTML, iframes (YouTube video, Vimeo, Google Maps).

Downloads

16

Readme

mPopup

Build Status

Fast, light and customizable jQuery popup plugin.

Optionally, install via Bower: bower install m-popup , install via NPM: npm install m-popup Install via NuGet PM> Install-Package mPopup

License

Released under the MIT license - http://opensource.org/licenses/MIT

Created by Balan Miroslav

Why should I use this popup?

  • Popup can contain images, video, or HTML content
  • Uses CSS transitions for slide animation ,native hardware acceleration
  • Small file size, fully themed, simple to implement
  • Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+
  • Many configuration options

For complete documentation and examples, visit: http://mirudev.com/mpopup/

How to install

Step 1: Link required files

First and most important, the jQuery library needs to be included (Google cdn or local jQuery file). Next, download the package from github or install via Bower: bower install m-popup , install via NPM: npm install m-popup, and link the mPopup CSS file (for the theme) and the mPopup Javascript file.

<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- mPopup Javascript file -->
<script src="/js/mPopup.jquery.min.js"></script>
<!-- mPopup CSS file -->
<link href="/lib/mPopup.css" rel="stylesheet">

Step 2: Create HTML markup

Create a <ul class="mPopup"> element, with any HTML content , in css have to show width and height of popup

<div class="mPopup">
    <!-- any HTML content -->
</div>
.mPopup{
    /* popup css code */
    width: 60%;
    height: 300px;
}

Step 3: Call the mPopup

Call .mPopup() on <ul class="mPopup">. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work!

$(document).ready(function(){
    // generate popup
    var popup = $('.mPopup').mPopup();
    // open generated popup
    popup.mPopup('open');
});

##Configuration options

Options

type Sets a fixed or absolute position for mPopup.

default : fixed
options : fixed , absolute

closeClass Class name to trigger closing of mPopup.

default : mPopup-close
options : string (class name)

closeOnOverlayClick Close mPopup when click on overlay.

default : true
options : boolean (true / false)

overlayClass Overlay class name.

default : mPopup-overlay
options : string (class name)

overlayFade Overlay with fade animation or just hide.

default : true
options : boolean (true / false)

animationType Animation type for popup on opening and closing.

default : fade
options : string (fade / slide) 

animationSpeed Speed of animation.

default : 400
options : (slow / fast) or integer 

positionElement Position popup relative to element.

default : null
options : jQuery object

typePositionObject Type position of element to align.

default : offset
options : (offset / position) 

modifyPosition Modification of current position of mPopup.

default : { top : 0, left : 0 }
options : Object 

Methods

open Manually opens a mPopup.

$('#elem').mPopup('open')

close Manually closes a mPopup.

$('#elem').mPopup('close')

recalculate-position Recalculate current position of mPopup.

$('#elem').mPopup('recalculate-position')

destroy Destroy created popup.

$('#elem').mPopup('destroy')

Events

onOpen Trigger on opening mPopup.

$('#popup').on('mPopop:open' = function (e) {
                   // do something...
                });

onClose Trigger on closing mPopup.

$('#popup').on('mPopop:close' = function (e) {
                   // do something...
                });

Changelog